Skip to content

ContextMenu

JaykeBird edited this page Feb 21, 2023 · 7 revisions

Back to home | Back to Reference | View raw text

ContextMenu class

Description

A popup menu that can display items specific to the context it's invoked by, with a visual style that matches the rest of the Solid Shine UI controls.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.ContextMenu[[ContextMenu]]
  end
  subgraph System.Windows.Controls
System.Windows.Controls.ContextMenu[[ContextMenu]]
  end
System.Windows.Controls.ContextMenu --> SolidShineUi.ContextMenu
Loading

Members

Properties

Public properties

Type Name Methods
Brush BorderBrush
Get or set the brush used for the border of the menu's drop-down area.
get, set
Brush CheckedBrush
Get or set the brush to use for the check highlight for checked menu items.
get, set
ColorScheme ColorScheme
Get or set the color scheme used for this control. The color scheme can quickly apply a whole visual style to your control.
get, set
Brush DisabledBrush
Get or set the brush used for the foreground/text of a child menu item when it is disabled.
get, set
Brush HighlightBrush
Get or set the brush used for the top-level menu items in the menu bar. This is not used in a ContextMenu; instead look at the HighlightSubitemBrush property.
get, set
Brush HighlightSubitemBrush
Get or set the brush used for menu items that aren't top-level on the menu bar, when the mouse is over them or they have keyboard focus.
get, set
Brush MenuBackground
Get or set the brush used for the background of the menu's drop-down area. This is different from the Background brush, which is not used in a ContextMenu.
get, set
bool RoundedCorners
Get or set if the context menu has rounded corners. When true, each corner has a corner radius of 4.
get, set
ScrollBarVisibility VerticalScrollBarVisibility
Get or set if a vertical scroll bar is visible for the context menu.
If the context menu is longer than the screen, the scroll bar can be used.
get, set

Methods

Public Static methods

Returns Name
void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Perform an action when the ColorScheme property has changed. Primarily used internally.

Public methods

Returns Name
void ApplyColorScheme(...)
Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

Details

Summary

A popup menu that can display items specific to the context it's invoked by, with a visual style that matches the rest of the Solid Shine UI controls.

Inheritance

  • ContextMenu

Constructors

ContextMenu

public ContextMenu()

Methods

OnColorSchemeChanged

public static void OnColorSchemeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Arguments
Type Name Description
DependencyObject d The object containing the property that changed.
DependencyPropertyChangedEventArgs e Event arguments about the property change.
Summary

Perform an action when the ColorScheme property has changed. Primarily used internally.

ApplyColorScheme [1/2]

public void ApplyColorScheme(ColorScheme cs)
Arguments
Type Name Description
ColorScheme cs The color scheme to apply.
Summary

Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

ApplyColorScheme [2/2]

public void ApplyColorScheme(HighContrastOption hco)
Arguments
Type Name Description
HighContrastOption hco The high-contrast color scheme to apply.
Summary

Apply a color scheme to this control. The color scheme can quickly apply a whole visual style to the control.

Properties

ColorScheme

public ColorScheme ColorScheme { get; set; }
Summary

Get or set the color scheme used for this control. The color scheme can quickly apply a whole visual style to your control.

MenuBackground

public Brush MenuBackground { get; set; }
Summary

Get or set the brush used for the background of the menu's drop-down area. This is different from the Background brush, which is not used in a ContextMenu.

DisabledBrush

public Brush DisabledBrush { get; set; }
Summary

Get or set the brush used for the foreground/text of a child menu item when it is disabled.

BorderBrush

public Brush BorderBrush { get; set; }
Summary

Get or set the brush used for the border of the menu's drop-down area.

HighlightBrush

public Brush HighlightBrush { get; set; }
Summary

Get or set the brush used for the top-level menu items in the menu bar. This is not used in a ContextMenu; instead look at the HighlightSubitemBrush property.

HighlightSubitemBrush

public Brush HighlightSubitemBrush { get; set; }
Summary

Get or set the brush used for menu items that aren't top-level on the menu bar, when the mouse is over them or they have keyboard focus.

CheckedBrush

public Brush CheckedBrush { get; set; }
Summary

Get or set the brush to use for the check highlight for checked menu items.

RoundedCorners

public bool RoundedCorners { get; set; }
Summary

Get or set if the context menu has rounded corners. When true, each corner has a corner radius of 4.

VerticalScrollBarVisibility

public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Summary

Get or set if a vertical scroll bar is visible for the context menu. If the context menu is longer than the screen, the scroll bar can be used.

Events

ColorSchemeChanged

public event DependencyPropertyChangedEventHandler ColorSchemeChanged
Summary

Raised when the ColorScheme property is changed.

Generated with ModularDoc

Clone this wiki locally