Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
960
Commands not launched by Contextmenu xammenuitems
posted

I have a XamDatatree in a UserControl and I've set a ContextMenu for some of the actions available on the main menu of the control inside the context menu.

The context menu is correctly shown but the click of the menu items does not execute the bound command.

The xammenuitems are all like the following

<ig:XamMenuItem  Command="lcmd:DataMaskCommands.NewNamesList">
	<ig:XamMenuItem.Header>
		<Label Content="{x:Static cr:NameListsEditorControlRx.mnuNewNamesList}"
		 HorizontalContentAlignment="Left" 
		 VerticalContentAlignment="Center"/>
		</ig:XamMenuItem.Header>
		<ig:XamMenuItem.Icon>
			<Image Source="/Myexe;Component/Images/btn_032_109.png" />
		</ig:XamMenuItem.Icon>
</ig:XamMenuItem>
The command binding is the following
<CommandBinding Command="{x:Static lcmd:DataMaskCommands.NewNamesList}" 
Executed="NewNamesList_Executed" CanExecute="NewNamesList_CanExecute" />

While this XamMenuItem works like a charm in the main menu of the window it does not execute the

command in the context menu. I suppose I've forgotten something fundamental in my code
but I don't know what it is, unfortunately, in the XamContextMenu samples, you use an Item clicked event handler
and there is no sample using the Command in a context menu.

if you have any clue

regards

Parents Reply Children