Added reviewing of results in graphic mode
This commit is contained in:
27
FieldVisualizer/InfraStructures/Comands/RelayCommand.cs
Normal file
27
FieldVisualizer/InfraStructures/Comands/RelayCommand.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace FieldVisualizer.Infrastructure.Commands
|
||||
{
|
||||
public class RelayCommand : ICommand
|
||||
{
|
||||
private Action<object> execute;
|
||||
private Func<object, bool> canExecute;
|
||||
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add => CommandManager.RequerySuggested += value;
|
||||
remove => CommandManager.RequerySuggested -= value;
|
||||
}
|
||||
|
||||
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
|
||||
{
|
||||
this.execute = execute;
|
||||
this.canExecute = canExecute;
|
||||
}
|
||||
|
||||
public bool CanExecute(object parameter) => canExecute == null || canExecute(parameter);
|
||||
|
||||
public void Execute(object parameter) => execute(parameter);
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,6 @@ namespace FieldVisualizer.InfraStructures.Strings
|
||||
public static class ErrorStrings
|
||||
{
|
||||
public static string ColorMapTypeIsUnknown => "#0001: ColorMap type is unknown";
|
||||
public static string PrimitiveTypeIsUnknown => "#0002: Type of primitive is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user