3

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 Answer 1

2

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" />
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you...I used the DisplayMemeberPath and it worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.