Reputation: 1469
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
Upvotes: 3
Views: 1338
Reputation: 2401
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" />
Upvotes: 2