I'm trying to create my own User Control, but the design view currently looks like this:
This is the XAML for my user control:
<UserControl.Resources>
<Style x:Key="ListboxItemStyle" TargetType="{x:Type ListBoxItem}">
<Style.Resources>
<SolidColorBrush x:Key="Black" Color="Black"></SolidColorBrush>
</Style.Resources>
<Setter Property="BorderBrush" Value="{DynamicResource Black}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
</UserControl.Resources>
<Grid>
<ScrollViewer HorizontalScrollBarVisibility="Auto" Width="335" Margin="-350,0,300,0" >
<ListBox HorizontalAlignment = "Left" ItemsSource = "{Binding Path = Stream.Objects}" SelectedIndex="{Binding Path = Stream.SelectedIndex, Mode = TwoWay}" ItemContainerStyle="{StaticResource ListboxItemStyle}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation = "Vertical">
<Label Width = "300" Margin = "3 5 3 5">
<Label.Content>
<AccessText TextWrapping="Wrap" Text="{Binding Path = Full_text, Mode = OneWay}"/>
</Label.Content>
</Label>
<Image Source="{Binding Path = Entities.Media[0].Media_url}" Width="300" Height="300"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
</Grid>
Is there something I can do to get my user control to render properly in the design view? I'm not having a problem viewing my MainWindow.xaml.
I'm currently using Visual Studio Community 2015 version 14.0.25431.01 Update 3, on Windows 7.
Visual Studio sometimes cannot draw corresponding view in Designer, if your XAML have complex resources, templates or styles. So there is no fix or hack to make this work. My suggestion is to ignore Designer View and always switch to Code view.