ContextMenuService
Provides methods for displaying a context menu for a document or tool window.
Definition
Namespace:Telerik.WinControls.UI.Docking
Assembly:Telerik.WinControls.RadDock.dll
Syntax:
public class ContextMenuService : RadDockService, IDisposable, INotifyPropertyChanged, INotifyPropertyChangingEx
Inheritance: objectRadDockObjectRadDockServiceContextMenuService
Implements:
Inherited Members
Constructors
Creates a context-menu service with document, tool-window, and active-window-list menus enabled.
public ContextMenuService()
Fields
Identifies the command that activates and reveals the associated dock window.
public const string ActivateWindow = "ActivateWindow"
Identifies the command that closes all windows in the document container.
public const string CloseAll = "CloseAll"
Identifies the command that closes unpinned windows in the document container.
public const string CloseAllButPinned = "CloseAllButPinned"
Identifies the command that closes every document window except the associated one.
public const string CloseAllButThis = "CloseAllButThis"
Identifies the command that closes the associated document window.
public const string CloseWindow = "CloseWindow"
Identifies the command that changes the associated window to the auto-hide state.
public const string DockStateAutoHide = "AutoHide"
Identifies the command that changes the associated window to the docked state.
public const string DockStateDocked = "Docked"
Identifies the command that changes the associated window to the floating state.
public const string DockStateFloating = "Floating"
Identifies the command that hides the associated window.
public const string DockStateHidden = "Hidden"
Identifies the command that changes the associated window to the tabbed-document state.
public const string DockStateTabbedDocument = "TabbedDocument"
Identifies the command that moves the associated document to the next tab group.
public const string MoveToNextTabGroup = "MoveToNextTabGroup"
Identifies the command that moves the associated document to the previous tab group.
public const string MoveToPrevTabGroup = "MoveToPrevTabGroup"
Identifies the command that places the associated document in a horizontal tab group.
public const string NewHTabGroup = "NewHTabGroup"
Identifies the command that places the associated document in a vertical tab group.
public const string NewVTabGroup = "NewVTabGroup"
Properties
Determines whether a context menu, listing all opened documents within a document strip, may be displayed.
public bool AllowActiveWindowListContextMenu { get; set; }
Determines whether context menus, associated with a document window may be displayed.
public bool AllowDocumentContextMenu { get; set; }
Determines whether context menus, associated with a tool window may be displayed.
public bool AllowToolContextMenu { get; set; }
Gets the currently displayed menu.
[Browsable(false)]
public RadContextMenu DisplayedMenu { get; }
Determines whether a context menu is currently displayed.
[Browsable(false)]
public bool IsMenuDisplayed { get; }
Methods
Determines whether a context menu can be displayed for the specified window.
Displays a context menu, listing all currently active documents within the specified document strip.
public void DisplayActiveWindowList(DocumentTabStrip strip, Point screenPos)
Displays a context menu at the specified screen position, associated with the provided DockWindow instance.
public void DisplayContextMenu(DockWindow window, Point screenPos)
Displays a context menu at the specified screen position, associated with the provided DockWindow instance.
public void DisplayContextMenu(RadElement owner, DockWindow window, Point screenPos)
Displays the context menu at the specified screen position, using the provided list of items.
protected virtual void DisplayMenuCore(List<RadMenuItemBase> items, Point screenPos)
Displays the context menu at the specified screen position, using the provided list of items.
protected virtual void DisplayMenuCore(RadElement menuOwner, List<RadMenuItemBase> items, Point screenPos)
Disposes the currently displayed menu before releasing the base service resources.
protected override void DisposeManagedResources()
Overrides:
Gets the menu items, associated with the specified DockWindow.
public List<RadMenuItemBase> GetContextMenuItems(DockWindow window, bool defaultAction)
True to execute the default action, associated with each item, when an item is clicked.
Returns:List<RadMenuItemBase>
Gets the menu items, associated with the specified DockWindow.
public List<RadMenuItemBase> GetContextMenuItems(DockWindow window)
List<RadMenuItemBase>
Performs the core action, depending on the clicked menu item.
protected virtual void PerformMenuItemAction(DockWindow window, RadMenuItemBase menuItem)
Events
Notifies that a context menu is about to be displayed.
public event ContextMenuDisplayingEventHandler ContextMenuDisplaying
Notifies that a context menu item has been clicked.
public event ContextMenuItemClickEventHandler ContextMenuItemClicked