Reputation: 9
I have created 1 Winform in that placed one Winform user control. In user control of designer written below code.
Here UC_WPF_UC1 is another user control which is having only a textblcok with width 900 and hosted this WPF user control in element host of width 920 still the text block text cropping.
Text is "This is wpf UC textblock which is having width 900, this is hosted in winform elementhost which is of width 920" which shows properly in xaml design UI file before running application.
I have already tried Dock to fill and some other solution but no luck..
XAML code
<UserControl x:Class="WindowsFormsApp3.UserControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WindowsFormsApp3"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="900">
<Border Margin="0,0,0,0" BorderThickness="0">
<Grid Background="#FFFFFF">
<TextBlock Foreground="#333333" FontSize="18" VerticalAlignment="Center" >This is wpf UC textblock which is having width 900, this is hosted in winform elementhost which is of width 920</TextBlock>
</Grid>
</Border>
</UserControl>
Upvotes: 0
Views: 198