Set base utilities + login page. Creation of localization resources. General project info.
This commit is contained in:
33
BodyshopUploader/Utils/RelayCommand.cs
Normal file
33
BodyshopUploader/Utils/RelayCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BodyshopUploader
|
||||
{
|
||||
public class RelayCommand : ICommand
|
||||
{
|
||||
private Predicate<object> _canExecute;
|
||||
private Action<object> _execute;
|
||||
|
||||
public RelayCommand(Predicate<object> canExecute, Action<object> execute)
|
||||
{
|
||||
this._canExecute = canExecute;
|
||||
this._execute = execute;
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add { CommandManager.RequerySuggested += value; }
|
||||
remove { CommandManager.RequerySuggested -= value; }
|
||||
}
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return _canExecute(parameter);
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user