Click or drag to resize

Command Class

Base command for use on either ToolBar or MenuBar
Inheritance Hierarchy

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.4.0
Syntax
public class Command : IBindable, ICommand

The Command type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyBindings
Gets the collection of bindings that are attached to this widget
Public propertyCommandParameter
Gets or sets the parameter to pass to the Command when executing or determining its CanExecute state.
Public propertyDataContext
Gets or sets the data context for this widget for binding
Public propertyDelegatedCommand
Gets or sets a command to delegate to when the command is invoked.
Public propertyEnabled
Gets or sets a value indicating whether this Command is enabled.
Public propertyID
Gets or sets the ID of the command
Public propertyImage
Gets or sets the image for the menu or tool item.
Public propertyMenuText
Gets or sets the text when shown on the menu.
Public propertyParent
Gets the parent widget which this widget has been added to, if any
Public propertyProperties
Gets the dictionary of properties for this widget
Public propertyShortcut
Gets or sets the shortcut to trigger this command.
Public propertyTag
Gets or sets a user-defined tag value for this instance.
Public propertyToolBarText
Gets or sets the tool bar text.
Public propertyToolTip
Gets or sets the tool tip on both the menu and toolbar.
Top
Methods
  NameDescription
Public methodCreateMenuItem
Creates a new menu item attached to this command.
Public methodCreateToolItem
Creates a new tool item attached to this command.
Public methodExecute
Execute the command programatically.
Protected methodOnDataContextChanged
Raises the DataContextChanged event
Protected methodOnEnabledChanged
Raises the EnabledChanged event.
Protected methodOnExecuted
Raises the Executed event.
Top
Events
  NameDescription
Public eventDataContextChanged
Event to handle when the DataContext has changed
Public eventEnabledChanged
Occurs when the Enabled property is changed.
Public eventExecuted
Occurs when the command is executed from either the menu or toolbar.
Top
Operators
Extension Methods
  NameDescription
Public Extension MethodBindT(String, DirectBindingT, DualBindingMode)Overloaded.
Adds a new dual binding between the control and the specified source binding
(Defined by BindableExtensions.)
Public Extension MethodBindT(IndirectBindingT, DirectBindingT, DualBindingMode)Overloaded.
Adds a new binding to the control with a direct value binding
(Defined by BindableExtensions.)
Public Extension MethodBindT(String, Object, String, DualBindingMode)Overloaded.
Adds a new dual binding between the control and the specified object
(Defined by BindableExtensions.)
Public Extension MethodBindT(IndirectBindingT, Object, IndirectBindingT, DualBindingMode, T, T)Overloaded.
Adds a new binding to the control with an indirect binding to the provided objectValue
(Defined by BindableExtensions.)
Public Extension MethodBindDataContextT(String, String, DualBindingMode, T, T)Overloaded.
Adds a new binding with the control and the the control's current data context
(Defined by BindableExtensions.)
Public Extension MethodBindDataContextT(IndirectBindingT, IndirectBindingT, DualBindingMode, T, T)Overloaded.
Adds a new binding from the control to its data context
(Defined by BindableExtensions.)
Top
Remarks
Commands allow you to create a single class that can be used for both menu and tool items.
See Also