Class CustomContextMenu
Represents a pop-up menu that enables a control to expose functionality that is specific to the context of the control. By default contains menu items that allow moving the element to different dock states.
Inheritance
Implements
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
[SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007BlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007BlackStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007SilverStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Blue, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010BlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Black, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010BlackStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Silver, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010SilverStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2003, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2003Style.xaml")]
[SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/BlendStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.SyncOrange, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/SyncOrangeStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/ShinyRedStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/ShinyBlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Default, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF;component/Framework/DockingManager/Themes/vista.aero.xaml")]
[SkinType(SkinVisualStyle = Skin.VS2010, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/VS2010Style.xaml")]
[SkinType(SkinVisualStyle = Skin.Transparent, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/TransparentStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/MetroStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2013, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2013Style.xaml")]
public class CustomContextMenu : ContextMenu, IDisposable
Constructors
CustomContextMenu()
Initializes a new instance of the CustomContextMenu class.
Declaration
public CustomContextMenu()
Fields
IsEnabledAutoHideMenuItemProperty
Identifies the IsEnabledAutoHideMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledAutoHideMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledDockableMenuItemProperty
Identifies the IsEnabledDockableMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledDockableMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledFloatingMenuItemProperty
Identifies the IsEnabledFloatingMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledFloatingMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledHiddenMenuItemProperty
Identifies the IsEnabledHiddenMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledHiddenMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledMaximizeMenuItemProperty
Identifies the IsEnabledMaximizeMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledMaximizeMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledMinimizeMenuItemProperty
Identifies the IsEnabledMinimizeMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledMinimizeMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledRestoreMenuItemProperty
Identifies the IsEnabledRestoreMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledRestoreMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEnabledTabbedMenuItemProperty
Identifies the IsEnabledTabbedMenuItem dependency property.
Declaration
public static readonly DependencyProperty IsEnabledTabbedMenuItemProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
IsEnabledAutoHideMenuItem
Gets or sets a value indicating whether the item which is responsible
for auto-hide is enabled.
true if the AutoHide menu item is enabled for an instance; otherwise, false.
Declaration
public bool IsEnabledAutoHideMenuItem { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsEnabledDockableMenuItem
Gets or sets a value indicating whether the item which is responsible
for dockable is enabled.
true if the dockable menu item is enabled for an instance; otherwise, false.
Declaration
public bool IsEnabledDockableMenuItem { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsEnabledFloatingMenuItem
Gets or sets a value indicating whether the item which is responsible
for floating is enabled.
true if the floating menu item for an instance is enabled; otherwise, false.
Declaration
public bool IsEnabledFloatingMenuItem { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsEnabledHiddenMenuItem
Gets or sets a value indicating whether the item which is responsible for hidden is enabled. ///
Declaration
public bool IsEnabledHiddenMenuItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsEnabledMaximizeMenuItem
Gets or sets a value indicating whether this instance is enabled maximize menu item.
Declaration
[Obsolete("This property is obsolete, since we have not show this menu item in ContextMenu.")]
public bool IsEnabledMaximizeMenuItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsEnabledMinimizeMenuItem
Gets or sets a value indicating whether this instance is enabled minimize menu item.
Declaration
[Obsolete("This property is obsolete, since we have not show this menu item in ContextMenu.")]
public bool IsEnabledMinimizeMenuItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsEnabledRestoreMenuItem
Gets or sets a value indicating whether this instance is enabled restore menu item.
Declaration
[Obsolete("This property is obsolete, since we have not show this menu item in ContextMenu.")]
public bool IsEnabledRestoreMenuItem { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsEnabledTabbedMenuItem
Gets or sets a value indicating whether the item which is responsible
for dockable is enabled.
true if the tabbed menu item is enabled for an instance; otherwise, false.
Declaration
public bool IsEnabledTabbedMenuItem { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
TargetElement
Gets the target element that the instance of CustomContextMenu belongs to. Returns: return the Target element
Declaration
public FrameworkElement TargetElement { get; }
Property Value
| Type |
|---|
| System.Windows.FrameworkElement |
Methods
Dispose()
Declaration
public void Dispose()
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
| Type | Description |
|---|---|
| System.Windows.DependencyObject | A TabItem. |
IsItemItsOwnContainerOverride(Object)
Determines whether the specified item is, or is eligible to be, its own item container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item | The item to check whether it is an item container. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the item is a System.Windows.Controls.MenuItem or a System.Windows.Controls.Separator otherwise, false. |
MinMemory()
Minimize the memory.Setting null for all the used items.
Declaration
public void MinMemory()
OnClosed(RoutedEventArgs)
Called when the window is closed. Performs cleanup by releasing references and calling the base implementation.
Declaration
protected override void OnClosed(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The event data for the System.Windows.Window.Closed event. |
OnInitialized(EventArgs)
Raises the Initialized event. This method is invoked whenever IsInitialized is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | The RoutedEventArgs that contains the event data. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Called when the items collection changes. Clears the floating item's content if the collection is reset.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | Provides data for the System.Collections.Specialized.NotifyCollectionChangedEventArgs event. |
OnOpened(RoutedEventArgs)
Called when the control or window is opened. Initializes references to the docking manager and retrieves the primary element from the templated parent if it is a NativeFloatWindow.
Declaration
protected override void OnOpened(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The event data for the System.Windows.RoutedEventArgs. |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the container for the specified item in the context menu.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | element | The container element used to display the specified item. |
| System.Object | item | The item to be displayed. |