Display properties of the ListBox.ItemsSource

后端 未结 2 1164
南旧
南旧 2020-12-04 02:20

I am new to WPF. I have a ListBox that has its ItemSource set to a instance of WorkItemCollection. (A collection of WorkItem objects.)

When the list is displayed i

2条回答
  •  青春惊慌失措
    2020-12-04 03:06

    You have two options.

    The simplest method is to set the DisplayMemberPath property of your ListBox to "Title".

    If you want to set not only what gets displayed, but the type of control that is used to display it, then you would set the ListBox's ItemTemplate.

    For what your goal is, I would recommend the first option.

提交回复
热议问题