| DelegateCommand Constructor |
Initializes a new instance of the
DelegateCommand class.
No callback is initially set, so they must be set via the property setters. This usage generates easy readable code even if the delegates are inlined.
Namespace:
TomsToolbox.Wpf
Assembly:
TomsToolbox.Wpf (in TomsToolbox.Wpf.dll)
Syntax Examples public ICommand DeleteCommand
{
get
{
return new DelegateCommand
{
CanExecuteCallback = delegate
{
return IsSomethingSelected();
},
ExecuteCallback = delegate
{
if (IsSomehingSelected())
{
DelteTheSelection();
}
}
};
}
}
See Also