I am in the process of learning WPF (I don’t know much yet). I know how to associate a menu subitem to an event by directly editing the xaml but, I’d like to know how to do the same thing using Visual Studio.
For instance, consider the following XAML snippet:
<Menu DockPanel.Dock ="Top"
HorizontalAlignment="Left" Background="White" BorderBrush ="Black">
<MenuItem Header="_File"/>
<Separator/>
<MenuItem Header ="_Exit"
MouseEnter ="MouseEnterExitArea"
MouseLeave ="MouseLeaveArea"
Click ="FileExit_Click"/>
I’d like to be able to associate the “_Exit” menuitem with the appropriate event handlers for MouseEnter, MouseLeave and Click using Visual Studio instead of manually editing the xaml text. I was trying to accomplish this by using the “Items” collection editor but, it seems to only allow editing of the subitem’s properties and not the events. Is there another editor/dialog/etc that allows editing the subitem’s events ?
Thank you for your help,
John.
P.S: thank you H.B for taking the time to format the xaml properly. 🙂
It does not seem to be possible to do this.