3
votes

When you set an observable collection as the item source of a context menu it lists the type of the each item...i would like to bind the name field of those items in the collection to the header...I cant seem to figure out how to

1

1 Answers

2
votes

Use DisplayMemberPath and put the name of the property on your item. Or you could use the ItemTemplate property.

Example:

<ContextMenu ItemsSource="{Binding YourCollection}"
             DisplayMemberPath="Name" />