Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.ContextMenuItem Class Reference

Used to define the items that will be displayed in the context menu. More...

Public Member Functions

 ContextMenuItem ()
 Create a menu seperator in the menu.
 ContextMenuItem (bool isSeparator=true, string label=null, Action action=null, Func< bool > isVisible=null, Func< bool > isDisabled=null, Func< bool > isChecked=null, Object userData=null)
 Context Menu Default implementation with all possible options.
 ContextMenuItem (string label, Action action=null)
 Represents an individual item in a context menu, providing the label and action.
 ContextMenuItem (string label, Action action=null, Func< bool > isVisible=null)
 Represents an item in a context menu, including its label, action to be performed, and visibility logic.
 ContextMenuItem (string label, Action action=null, Func< bool > isVisible=null, Func< bool > isDisabled=null)
 Creates an item with supplied visibility/disabled predicates.
 ContextMenuItem (string label, Action action=null, Func< bool > isVisible=null, Func< bool > isDisabled=null, Func< bool > isChecked=null)
 Represents an item in a context menu, providing its display label, associated action, and optional logic for visibility, enablement, and selection state.
 ContextMenuItem (string label, Action action=null, Func< bool > isVisible=null, Func< bool > isDisabled=null, Func< bool > isChecked=null, Object userData=null)
 Represents an item in a context menu, providing its display label, associated action, and optional logic for visibility, enablement, and selection state.

Data Fields

Action Action
 Optional application operation invoked on enabled item activation.
Func< bool > IsChecked
 Checkmark predicate; supply a nonnull delegate for visible nonseparator items.
Func< bool > IsDisabled
 Disabled-state predicate; supply a nonnull delegate for visible nonseparator items.
bool IsSeparator
 Whether this entry renders a separator instead of an actionable row.
Func< bool > IsVisible
 Visibility predicate evaluated on menu construction; null means visible.
string Label
 Text displayed for a nonseparator item.
Object UserData
 Application-owned metadata stored on this model.

Detailed Description

Used to define the items that will be displayed in the context menu.

Constructor & Destructor Documentation

◆ ContextMenuItem() [1/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( string label,
Action action = null )
inline

Represents an individual item in a context menu, providing the label and action.

Parameters
labelText to display in the menu
actionAction to Invoke when activated

◆ ContextMenuItem() [2/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( string label,
Action action = null,
Func< bool > isVisible = null )
inline

Represents an item in a context menu, including its label, action to be performed, and visibility logic.

Parameters
labelText to display in the menu
actionAction to Invoke when activated
isVisibleBool Func - Should the item be displayed undercurrent conditions

◆ ContextMenuItem() [3/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( string label,
Action action = null,
Func< bool > isVisible = null,
Func< bool > isDisabled = null )
inline

Creates an item with supplied visibility/disabled predicates.

Arguments are stored verbatim. Null IsVisible means visible, but null IsDisabled is not safe for a visible row because Show invokes it directly. Supply () => false when the item is enabled. Overloads that accept IsChecked likewise require a nonnull predicate.

Parameters
labelText to display in the menu
actionAction to Invoke when activated
isVisibleBool Func - Should the item be displayed undercurrent conditions
isDisabledBool Func - Show the item but in a disabled state based on data

◆ ContextMenuItem() [4/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( string label,
Action action = null,
Func< bool > isVisible = null,
Func< bool > isDisabled = null,
Func< bool > isChecked = null )
inline

Represents an item in a context menu, providing its display label, associated action, and optional logic for visibility, enablement, and selection state.

Parameters
labelText to display in the menu
actionAction to Invoke when activated
isVisibleBool Func - Should the item be displayed undercurrent conditions
isDisabledBool Func - Show the item but in a disabled state based on data
isCheckedBool Func - Show a check mark next to the item in the menu

◆ ContextMenuItem() [5/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( string label,
Action action = null,
Func< bool > isVisible = null,
Func< bool > isDisabled = null,
Func< bool > isChecked = null,
Object userData = null )
inline

Represents an item in a context menu, providing its display label, associated action, and optional logic for visibility, enablement, and selection state.

Parameters
labelText to display in the menu
actionAction to Invoke when activated
isVisibleBool Func - Should the item be displayed undercurrent conditions
isDisabledBool Func - Show the item but in a disabled state based on data
isCheckedBool Func - Show a check mark next to the item in the menu
userDataOptional user data object to store in the userdata container of the visual element

◆ ContextMenuItem() [6/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( )
inline

Create a menu seperator in the menu.

Here is the caller graph for this function:

◆ ContextMenuItem() [7/7]

GWG.WindowFramework.ContextMenuItem.ContextMenuItem ( bool isSeparator = true,
string label = null,
Action action = null,
Func< bool > isVisible = null,
Func< bool > isDisabled = null,
Func< bool > isChecked = null,
Object userData = null )
inline

Context Menu Default implementation with all possible options.

Parameters
isSeparatorMake the item as a seperator
labelText to display in the menu
actionAction to Invoke when activated
isVisibleBool Func - Should the item be displayed undercurrent conditions
isDisabledBool Func - Show the item but in a disabled state based on data
isCheckedBool Func - Show a check mark next to the item in the menu
userDataOptional user data object to store in the userdata container of the visual element

Field Documentation

◆ Action

Action GWG.WindowFramework.ContextMenuItem.Action

Optional application operation invoked on enabled item activation.

Exceptions propagate and can prevent the subsequent renderer removal/onClose calls. The framework does not perform authorization or business validation for this callback.

◆ IsChecked

Func<bool> GWG.WindowFramework.ContextMenuItem.IsChecked

Checkmark predicate; supply a nonnull delegate for visible nonseparator items.

◆ IsDisabled

Func<bool> GWG.WindowFramework.ContextMenuItem.IsDisabled

Disabled-state predicate; supply a nonnull delegate for visible nonseparator items.

True disables the action. This is the inverse of an enabled predicate.

◆ IsSeparator

bool GWG.WindowFramework.ContextMenuItem.IsSeparator

Whether this entry renders a separator instead of an actionable row.

◆ IsVisible

Func<bool> GWG.WindowFramework.ContextMenuItem.IsVisible

Visibility predicate evaluated on menu construction; null means visible.

◆ Label

string GWG.WindowFramework.ContextMenuItem.Label

Text displayed for a nonseparator item.

◆ UserData

Object GWG.WindowFramework.ContextMenuItem.UserData

Application-owned metadata stored on this model.

The current menu renderer does not transfer this value to the generated row. Capture required metadata in Action explicitly; do not rely on row.userData being populated.