I recently switched my WPF app to use RadMenu and RadMenuItems. After making this change, I noticed a subtle difference in behavior.The problem is that when a new window is launched in response to a RadMenuitem click, it is immediately deactivated. I proved this by hooking the Deactivated event of the window I was opening. (See the stack trace below.) I have confirmed that this problem is due to RadMenu/RadMenuItem - changing back to WPF Menu/MenuItem made the problem go away. The deactivated window is a problem because immediately after launch users try to interact with the window, and there is a short delay to activate it again.
I have an MVVM WPF application. I open new windows by sending a message (mediator pattern) from the MainViewModel to the MainView. The MainView creates a new window, associates a view model to datacontext, and calls Show():
The MainViewModel has an ICommand instance called ShowDiagnosticviewCommand. This Command is bound to the RadMenuItem in my MainView as follows:
The MainViewModel has the following code:
Here is the call stack when i break on the Window_Deactivated event of the window being launched:
My guess is that somehow the window is losing focus back to the RadmenuItem after the bound command is fired, possibly on the RadmenuItem.OnIsSubmenuOpenChanged().
For now, I have switched back to using the default WPF menu. I prefer the Radmenu because of the nice theme support. Any help with this problem will be appreciated.