News
Sometimes it happens that a ICommand shold be called with a specific parameter only.
To have this it is needed to get the object parameter and cast it to the right type.
ClosingCommand = new DelegateCommand(WindowClosing);
public ICommand ClosingCommand { get; set; }
private void WindowClosing(object arg)
{
var e = (WindowClosingArgs)arg;
}
To prevent this senseless casting I have created an additional DelegateCommand which takes the corresponding object type.
ClosingCommand = new DelegateCommand<WindowClosingArgs>(WindowClosing);
public ICommand ClosingCommand { get; set; }
private void WindowClosing(WindowClosingArgs e)
{
}
Supported with the current DW.SharpTools are both. The non generic DelegateCommand passes just objects.
Facts:
Library: DW.SharpTools
Version: 12.1.11.0
Date: 2012-1-11 20:57