public class RadioCommand : CheckCommand
Command for a radio button for a tool or menu item.
Remarks: A radio command works by using a Controller which allows you to group the radio buttons together.

Constructors

RadioCommand

#
public RadioCommand(EventHandler<EventArgs> execute)
Initializes a new instance of the RadioCommand class with the specified execute handler.

Properties

Bindings

public BindingCollection Bindings { get; }
Gets the collection of bindings that are attached to this widget
inherited fromCommand

Checked

public bool Checked { get; set; }
Gets or sets a value indicating whether this command is checked.
inherited fromCheckCommand

CommandParameter

public object CommandParameter { get; set; }
Gets or sets the parameter to pass to the Command when executing or determining its CanExecute state.
inherited fromCommand

Controller

#
public RadioCommand Controller { get; set; }
Gets or sets the controller of the radio button group.

DataContext

public object DataContext { get; set; }
Gets or sets the data context for this widget for binding
inherited fromCommand
Remarks: Subclasses may override the standard behaviour so that hierarchy of widgets can be taken into account. For example, a Control may return the data context of a parent, if it is not set explicitly.
DataContext

DelegatedCommand

public ICommand DelegatedCommand { get; set; }
Gets or sets a command to delegate to when the command is invoked.
inherited fromCommand
Remarks: This allows you to use a command to define menu/toolbar items or other functionality, and use a delegated command to chain to when invoked. This is especially useful when binding to a view model, you can do something like the following:
var myCommand = new Command { MenuText = "My Command", Parent = myForm };
myCommand.BindDataContext(c => c.DelegatedCommand, (MyModel m) => m.MyModelCommand);

//...

myForm.DataContext = new MyModel { MyModelCommand = ... };
The ICommand.CanExecute(object) will also used to set the enabled/disabled state of the current command.
The command to invoke.

Enabled

public virtual bool Enabled { get; set; }
Gets or sets a value indicating whether this Command is enabled.
inherited fromCommand

ID

public string ID { get; set; }
Gets or sets the ID of the command
inherited fromCommand
Remarks: This can be used to identify a command.
The command ID.

Image

public Image Image { get; set; }
Gets or sets the image for the menu or tool item.
inherited fromCommand
Remarks: On some platforms, the menu bar does not show the image by default (e.g. OS X). You can override this behaviour using a style on the handler.
The image for menu or tool items.

IsDataContextChanging

public bool IsDataContextChanging { get; set; }
Gets a value indicating that the Command.DataContext property is changing.
inherited fromCommand
Remarks: This can be used to determine when to allow certain logic during the update of the data context. It is used to disable binding setters on the model when the data context changes so that a binding does not cause the view model to be updated when the state hasn't been fully set yet.
true if the DataContext is currently changing, false otherwise.

Parent

public IBindable Parent { get; set; }
Gets the parent widget which this widget has been added to, if any
inherited fromCommand

Shortcut

public Keys Shortcut { get; set; }
Gets or sets the shortcut to trigger this command.
inherited fromCommand

Tag

public object Tag { get; set; }
Gets or sets a user-defined tag value for this instance.
inherited fromCommand

ToolBarText

public string ToolBarText { get; set; }
Gets or sets the tool bar text.
inherited fromCommand

ToolTip

public string ToolTip { get; set; }
Gets or sets the tool tip on both the menu and toolbar.
inherited fromCommand

Methods

CreateMenuItem

#
public override MenuItem CreateMenuItem()
Creates a new menu item attached to this command.

CreateToolItem

#
public override ToolItem CreateToolItem()
Creates a new tool item attached to this command.

OnDataContextChanged

protected internal virtual void OnDataContextChanged(EventArgs e)
inherited fromCommand
Remarks: Implementors may override this to fire this event on child widgets in a heirarchy. This allows a control to be bound to its own Command.DataContext, which would be set on one of the parent control(s).
e (EventArgs)Event arguments

Events

DataContextChanged

public event EventHandler<EventArgs> DataContextChanged
Event to handle when the Command.DataContext has changed
inherited fromCommand
Remarks: This may be fired in the event of a parent in the hierarchy setting the data context. For example, the Container widget fires this event when it's event is fired.
DataContextChanged

Executed

public event EventHandler<EventArgs> Executed
Occurs when the command is executed from either the menu or toolbar.
inherited fromCommand