Class DelegateCommand<T>
Inheritance
System.Object
DelegateCommand<T>
Implements
System.Windows.Input.ICommand
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Windows.Shared
Assembly: Syncfusion.Shared.Wpf.dll
Syntax
public class DelegateCommand<T> : ICommand
Type Parameters
Name |
---|
T |
Constructors
DelegateCommand(Action<T>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<T> method)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | method | The method. |
DelegateCommand(Action<T>, Predicate<T>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<T> method, Predicate<T> canExecute)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | method | The method. |
System.Predicate<T> | canExecute | The can execute. |
Methods
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 |
---|---|---|
System.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 |
---|---|
System.Boolean | true if this command can be executed; otherwise, false. |
Execute(Object)
Defines the method to be called when the command is invoked.
Declaration
public void Execute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | Data used by the command. If the command does not require data to be passed, this object can be set to null. |
RaiseCanExecuteChanged()
Raises CanExecuteChanged event to notify changes in command status.
Declaration
public void RaiseCanExecuteChanged()
Events
CanExecuteChanged
Declaration
public event EventHandler CanExecuteChanged
Event Type
Type |
---|
System.EventHandler |
Implements
System.Windows.Input.ICommand