This is the code which I'm working:
<TextBlock TextWrapping="Wrap" Text="{Binding Objective}" Grid.Column="0" VerticalAlignment="Center" FontWeight="Bold" />
<ItemsControl ItemsSource="{Binding Problems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Rectangle Stroke="Black" Height="20" Width="20" Margin="1,0" />
</DataTemplate>
</ItemsControl.ItemTemplate>
When set ItemsSource to listBox. It contains:
List<Container>
(Below container properties)
- Objective: string
- Problems: List<UserControls>
Look at this line: <ItemsControl ItemsSource="{Binding Problems}" >
In the code, Problems is a list of UserControls. When I load the program, the listbox is showing the controls from the user control and it's supposed to show the rectangle.
What am I doing wrong?