Show / Hide Table of Contents

Class RelayCommand

A Helper class to bind UI Events to simple Map methods.

Inheritance
object
RelayCommand
Implements
ICommand
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OffRouteMap
Assembly: OffRouteMap.dll
Syntax
public class RelayCommand : ICommand

Constructors

| Edit this page View Source

RelayCommand(Action, Func<bool>)

Declaration
public RelayCommand(Action execute, Func<bool> canExecute = null)
Parameters
Type Name Description
Action execute
Func<bool> canExecute

Methods

| Edit this page View Source

CanExecute(object)

Defines the method that determines whether the command can execute in its current state.

Declaration
public bool CanExecute(object parameter)
Parameters
Type Name Description
object parameter

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Returns
Type Description
bool

true if this command can be executed; otherwise, false.

| Edit this page View Source

Execute(object)

Defines the method to be called when the command is invoked.

Declaration
public void Execute(object parameter)
Parameters
Type Name Description
object parameter

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Events

| Edit this page View Source

CanExecuteChanged

Occurs when changes occur that affect whether or not the command should execute.

Declaration
public event EventHandler CanExecuteChanged
Event Type
Type Description
EventHandler

Implements

ICommand
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX