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

后端 未结 4 521
情话喂你
情话喂你 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:56

    The easiest way is to override ToString on your FileItem, (The listbox uses this to populate each entry)

        public override string ToString()
        {
            return Name;
        }
    

提交回复
热议问题