Specify ControlTemplate for ItemsControl.ItemContainerStyle

前端 未结 2 1546
不思量自难忘°
不思量自难忘° 2020-12-24 07:37

The following is similar to what I\'m trying to accomplish. However, I get the error

Invalid PropertyDescriptor value.

on the

2条回答
  •  粉色の甜心
    2020-12-24 08:10

    Also if you only want to do all of it with XAML you can simply use ListBox instead of ItemsControl and define a style for ListBoxItem:

            
            
                
            
            
                
                    
                
            
        
    

    Note that because I am using ListBox the container is ListBoxItem(Generally the container for WPF's default list control is always named the Item) so we create a style for ListBoxItem: