and now the details…
First if all this is my first encounter with WPF so please forgive I am missing something obvious etc.
What I have is a Menu with Menu Items bound to a DataView each menu item is a Row in DataView MenuItem Text is set to a Field in Row… menu is populated well and I can see all rows listed there! but when clicked nothing happens.
My Problem is how I can assign a click event to Menu Item, below is the XAML of ItemPresenter of parent menuitem
<MenuItem Name="mnuRowsDropDown" Header="All Rows ▼"
Height="23"
Loaded="mnuNotesDropDown_Loaded" ItemsSource="{Binding Path=Title, Mode=OneWay}" >
<MenuItem.ItemContainerStyle>
<Style>
<Setter Property="MenuItem.Header" Value="{Binding Title}"/>
<!--<Setter Property="MenuItem.Click" Value="" />-->
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
</MenuItem>
As you can see here I commented the Click Code because designed said it is an error
There’s a special setter for that called
EventSetter, use that instead. (When creatingMenuItemsdynamically it may be of interest to use commands instead as those can easily be included in the object you use for the binding along with the Header)