Hi,
I am trying to add a custom context menu item (Setting) in a RadPane dock control MenuItem.
I am stuck at to attached the custom contextMenu item.
Following is the code which I did :
http://www.telerik.com/help/silverlight/raddocking-how-to-add-menu-items-to-the-radpanes-menu.html
Thanks
H@rdik Pancholi
I am trying to add a custom context menu item (Setting) in a RadPane dock control MenuItem.
I am stuck at to attached the custom contextMenu item.
Following is the code which I did :
public class ViewPartSettingMenuCommand : RoutedUICommand { public ViewPartSettingMenuCommand() : base("Settings", "ViewPartSettingMenuCommand", typeof(ViewPartSettingMenuCommand)) { } } In the constructor of the view :I have referred the following link:CommandManager.SetCommandBindings(this, this.GetCommandBindings());public CommandBindingCollection GetCommandBindings() { CommandBindingCollection bindings = new CommandBindingCollection(); bindings.Add(new CommandBinding(this.Resources["ViewPartSettingMenuCommand"] as ViewPartSettingMenuCommand, this.OnViewPartSettingMenuCommandExecute)); return bindings; }In the resources :<DataTemplate x:Key="XamlContextMenu"> <telerik:RadContextMenu> <telerik:RadMenuItem Header="Floating" Command="telerik:RadDockingCommands.Floating" /> <telerik:RadMenuItem Header="Dockable" Command="telerik:RadDockingCommands.Dockable" /> <telerik:RadMenuItem x:Name="ViewPartSettingMenuCommand" /> </telerik:RadContextMenu> </DataTemplate>in the RadPane :<telerik:RadPane x:Name="XamlPane" CanFloat="False" ContextMenuTemplate="{StaticResource XamlContextMenu}">
http://www.telerik.com/help/silverlight/raddocking-how-to-add-menu-items-to-the-radpanes-menu.html
Thanks
H@rdik Pancholi