
Hi,
In the 2015 version i can remove a specific menuitem with the following code
For curPos As Integer = e.ContextMenu.Items.Count - 1 To 0 Step -1
Dim mnuItem As MenuItem = TryCast(e.ContextMenu.Items(curPos), MenuItem)
If mnuItem IsNot Nothing Then
Dim mnuCmd As RoutedUICommand = CType(mnuItem.Command, RoutedUICommand)
If mnuCmd.Name = "MoveToNewHorizontalContainer" Or
mnuCmd.Name = "MoveToNewVerticalContainer" Then
e.ContextMenu.Items.Remove(mnuItem)
End If
End If
Next
Now in the 2016 version i cannot use anymore the CType(mnuItem.Command, RoutedUICommand). How I achieve the same in the 2016 version?
Thanks
Marcel