Class ReferenceContextMenu
Common context menu for controls that edit reference values, such as lookup and locator controls.
[TypeStore]
public class ReferenceContextMenu
- Inheritance
-
ReferenceContextMenu
- Inherited Members
- Extension Methods
Constructors
ReferenceContextMenu()
Constructor.
public ReferenceContextMenu()
Fields
MenuHost
The menu command host.
protected IReferenceContextMenuHost MenuHost
Field Value
fCallerControl
The caller control used when opening the menu explicitly.
protected Control fCallerControl
Field Value
- Control
Properties
Binding
The binding this instance serves.
public TripousBinding Binding { get; protected set; }
Property Value
Menu
The actual Avalonia context menu.
public ContextMenu Menu { get; protected set; }
Property Value
- ContextMenu
mnuAdd
Add menu item.
public MenuItem mnuAdd { get; protected set; }
Property Value
- MenuItem
mnuClear
Clear menu item.
public MenuItem mnuClear { get; protected set; }
Property Value
- MenuItem
mnuEdit
Edit menu item.
public MenuItem mnuEdit { get; protected set; }
Property Value
- MenuItem
mnuReload
Reload menu item.
public MenuItem mnuReload { get; protected set; }
Property Value
- MenuItem
mnuShowList
Show List menu item.
public MenuItem mnuShowList { get; protected set; }
Property Value
- MenuItem
Methods
AnyMenuItem_Click(object, RoutedEventArgs)
Dispatches a menu click to the corresponding operation.
protected virtual void AnyMenuItem_Click(object Sender, RoutedEventArgs Args)
Parameters
SenderobjectThe event sender.
ArgsRoutedEventArgsThe routed event arguments.
CanOpen()
Returns true when this context menu can open.
protected virtual bool CanOpen()
Returns
- bool
True if the context menu can open; otherwise, false.
CreateContext(ReferenceMenuActionType)
Creates a reference menu command context.
protected virtual ReferenceMenuCommandContext CreateContext(ReferenceMenuActionType ActionType)
Parameters
ActionTypeReferenceMenuActionTypeThe action type.
Returns
- ReferenceMenuCommandContext
The created command context.
EnableMenuItems()
Enables or disables menu items according to the current context.
protected virtual void EnableMenuItems()
GetActionType(MenuItem)
Returns the action type represented by a menu item.
protected virtual ReferenceMenuActionType GetActionType(MenuItem MenuItem)
Parameters
MenuItemMenuItemThe menu item.
Returns
- ReferenceMenuActionType
The reference menu action type.
GetFormName()
Returns the reference form name.
protected virtual string GetFormName()
Returns
- string
The reference form name.
GetRowId()
Returns the current reference row identifier.
protected virtual object GetRowId()
Returns
- object
The current reference row identifier, if any; otherwise, null.
Initialize(IReferenceContextMenuHost, TripousBinding)
Initializes this reference context menu.
public virtual void Initialize(IReferenceContextMenuHost MenuHost, TripousBinding Binding)
Parameters
MenuHostIReferenceContextMenuHostThe menu command host.
BindingTripousBindingThe binding this menu serves.
Open(Control)
Opens the context menu for a control.
public virtual bool Open(Control Control)
Parameters
ControlControlThe caller control.
Returns
- bool
True if the menu opened; otherwise, false.