I'm having a hard time getting this to work, and I'm hopelessly confused with all the templates one needs to use. Here's the situation.
I want to have a menu dynamically created. The code takes a list of objects, groups the list, and then sets the itemsource of the menu.
navBarControl.NavBarMain.ItemsSource = newActions.GroupBy(Function(p) p.GroupName)
I need help with the templating and databinding in XAML. What I'm looking to happen is to have a menu created with the top items being the group key, and then the children for each key being the items themselves.
And then I need to have a click handler set for every child so that I can execute code on a menu item click.
This is proving to be difficult for me to accomplish. Can some one provide a XAML example of how this would work?