I am new to WPF. I have a ListBox that has an ItemSource set to an instance of WorkItemCollection . (A collection of WorkItem objects .)
When the list is displayed, it displays only the type of each object (Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem). Is there a way to make the list display WorkItem.Title?
You have two options.
The easiest way is to set the DisplayMemberPath of your ListBox to "Title".
, , , , ListBox ItemTemplate.
.
DataTemplate ItemTemplate ListBox:
DataTemplate
ItemTemplate
ListBox
<ListBox ItemSource="{Binding}"> <ListBox.ItemTemplate> <DataTemplate DataType="tfs:WorkItem"> <StackPanel> <TextBlock Text="{Binding Title}" /> <!-- Others --> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
Source: https://habr.com/ru/post/1721653/More articles:Cannot Get Reference to ConfigurationManager - .netBest approach to physics animation in Silverlight? - animationDisable display of the full path to the file in the "Find Results" window in Visual Studio 2008 - findUsing the ZK Tree component, how to remove Treeitems from Treechildren node - treedbus: flash connection? - cVisual Studio error list hidden - visual-studio-2008Can Visual Studio 2008 give hints about implementing an interface method - c #Doctrine - As you ask WHERE cond1 AND (cond2 OR cond3) - sqlRails - providing a license key for a host-based plugin - ruby-on-railsMac + Ruby: unable to access ioctl socket? How to fix? - ruby | fooobar.comAll Articles