I'm using WPF Menu. I have about 20 different menu buttons and in my XAML code I associate a Click event to each menu item.
Is this the preferred way?
I'm using WPF Menu. I have about 20 different menu buttons and in my XAML code I associate a Click event to each menu item.
Is this the preferred way?
Well, you can certainly do it this way, or you can use commands instead. See e.g. this tutorial.
Commands are preferred, more easy, more decoupled (see the Dmitri tutorial). Another solution is to use a single event handler for all menus in which you have a switch to choose which part should be executed.