C# 显示Listbox的多成员路径
我正在将列表框的ItemsSource绑定到事件类的列表。 事件具有以下属性:C# 显示Listbox的多成员路径,c#,wpf,C#,Wpf,我正在将列表框的ItemsSource绑定到事件类的列表。 事件具有以下属性: Date Title Company Description 我当前可以使用以下行显示这些属性中的任意一个: <ListBox ItemsSource="{Binding FilteredEventsCollection}" DisplayMemberPath="Date"/> 我想显示所有信息,请问我该怎么做?使用在列表框中的不同控件中显示各种属性 <ListBox ItemsSource
Date
Title
Company
Description
我当前可以使用以下行显示这些属性中的任意一个:
<ListBox ItemsSource="{Binding FilteredEventsCollection}" DisplayMemberPath="Date"/>
我想显示所有信息,请问我该怎么做?使用在列表框中的不同控件中显示各种属性
<ListBox ItemsSource="{Binding FilteredEventsCollection}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Date}" />
<TextBlock Text="{Binding Title}" />
<TextBlock Text="{Binding Company}" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>