WPF - Very basic ListBox.ItemTemplate Question

前端 未结 3 945
执笔经年
执笔经年 2021-02-05 11:46

Ok, this is an embarassingly simple-looking problem, but is driving me crazy. I\'m learning about DataTemplating and am trying to apply a very VERY simple ItemTemplate to a List

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 12:27

    For some reason DataTemplate can still be ignored if the ListBox is populated using ItemsSource e.g:

        
            
                
                    
                
            
        
    

    Note that this is bound to an ObservableCollection containing objects (TextAdapter : INotifyPropertyChanged) with one property: string Text {...}

提交回复
热议问题