Thursday, December 28, 2017

Difference Between ItemPanel and ItemTemplate

 ItemsSource="{Binding}">
  
    
       Background="SteelBlue" Padding="5" BorderBrush="Black"
        BorderThickness="1" Margin="0,2">
         Text="{Binding}"/>
      
    
Background="DarkKhaki"/>
And the result:
WPF ListBox templates example
The ItemTemplate determines the layout of each item in the list. On the other hand the ItemsPanel is the panel that will contain the individual items. Given the above definition the visual tree will be something similar to this:

No comments:

Followers

Link