Class DelegateCommand
Represents a class for the delegate command
Inheritance
System.Object
DelegateCommand
Implements
System.Windows.Input.ICommand
Namespace: Syncfusion.UI.Xaml.Controls.Input
Assembly: Syncfusion.SfInput.UWP.dll
Syntax
public class DelegateCommand : Object, ICommand
Constructors
DelegateCommand(Action<Object>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<object> executeAction)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeAction | execute action |
See Also
DelegateCommand(Action<Object>, Predicate<Object>)
Initializes a new instance of the DelegateCommand class.
Declaration
public DelegateCommand(Action<object> executeAction, Predicate<object> canExecute)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | executeAction | execute action |
System.Predicate<System.Object> | canExecute | boolean value, indicates execute the command or not |
See Also
Methods
CanExecute(Object)
Returns a value if can execute
Declaration
public bool CanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | parameter to execute |
Returns
Type | Description |
---|---|
System.Boolean | Returns a value if can execute |
Execute(Object)
Executes the parameter command
Declaration
public void Execute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | parameter to execute |
UpdateCanExecute()
Invokes event if can execute
Declaration
public void UpdateCanExecute()
Events
CanExecuteChanged
Occurs when value of CanExecute as changed
Declaration
public event EventHandler CanExecuteChanged
Event Type
Type |
---|
System.EventHandler |
Implements
System.Windows.Input.ICommand