I want to know how the context menu is being opened in "Opening" event of it.
Usually there are two ways to open it, One is by right clicking other is by Hitting on key.Apps' on keyboard.
This need is because based on way of opening the context menu changes my menu items.
<
telerik:RadTreeListView
x:Name
=
"RadTreeListView1"
IsSynchronizedWithCurrentItem
=
"True"
IsReadOnly
=
"True"
ItemsSource
=
"{Binding Folders}"
Width
=
"600"
MinHeight
=
"300"
SelectedItem
=
"{Binding SelectedItem}"
Height
=
"550"
CanUserFreezeColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
SelectionMode
=
"Extended"
ColumnWidth
=
"*"
local:MySelectedItemsBindingBehavior.SelectedItems
=
"{Binding SelectedItemCollection}"
> <
telerik:EventToCommandBehavior.EventBindings
> <
telerik:EventBinding
EventName
=
"SelectionChanging"
Command
=
"{Binding SelectionChangedCommand}"
PassEventArgsToCommand
=
"True"
/> <
telerik:EventBinding
EventName
=
"MouseRightButtonDown"
Command
=
"{Binding testingtesting}"
PassEventArgsToCommand
=
"True"
/> <
telerik:EventBinding
EventName
=
"KeyDown"
Command
=
"{Binding KeyDownCmd}"
PassEventArgsToCommand
=
"True"
/> </
telerik:EventToCommandBehavior.EventBindings
> <
telerik:RadContextMenu.ContextMenu
> <
telerik:RadContextMenu
x:Name
=
"GridContextMenu"
ItemsSource
=
"{Binding ContextMenuSelectedItems}"
> <
telerik:EventToCommandBehavior.EventBindings
> <
telerik:EventBinding
EventName
=
"Opening"
Command
=
"{Binding ContextButtonClick}"
PassEventArgsToCommand
=
"True"
/> </
telerik:EventToCommandBehavior.EventBindings
> </
telerik:RadContextMenu
> </
telerik:RadContextMenu.ContextMenu
> </
telerik:RadTreeListView
>
Event args for my "ContextButtonClick" command does not have any information about how it is being opened.
Having validation check of "KeyBoard.IsDown(Key.Apps) or KeyBoard.IsUp(Key.Apps)" is also not solving because, after releasing the "apps" button only context menu will start opening, so at point checking the stat of "Apps" button doesn't give us confident results.
Any help in this regards is much appreciated.