WPF/C# Binding custom object list data to a ListBox?

后端 未结 4 510
情话喂你
情话喂你 2021-02-05 05:12

I\'ve ran into a bit of a wall with being able to bind data of my custom object list to a ListBox in WPF.

This is the custom object:

public          


        
4条回答
  •  悲&欢浪女
    2021-02-05 05:40

    In case anyone comes across this now via search, I just encountered pretty much the same issue in a C# UWP app.

    While the XAML bits in Nitin's answer above were necessary, they didn't fix the issue alone -- I also had to change my equivalent of Folder to be an ObservableCollection, rather than a List, to get the ListBox to show the property I needed.

提交回复
热议问题