Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

ObservableRelayCommand.cs
Go to the documentation of this file.
1 using System;
2
3 namespace Microscopic_Traffic_Simulator
4 {
9 class ObservableRelayCommand : RelayCommand
10 {
15 public ObservableRelayCommand(Action<object> execute) : base(execute) { }
16
22 public ObservableRelayCommand(Action<object> execute, Predicate<object> canExecute)
23 : base(execute, canExecute) { }
24
28 public event EventHandler CommandExecuted = delegate { };
29
34 public override void Execute(object parameter)
35 {
36 base.Execute(parameter);
37 if (CommandExecuted != null)
38 CommandExecuted(this, EventArgs.Empty);
39 }
40 }
41 }
Microscopic_Traffic_Simulator.ObservableRelayCommand.ObservableRelayCommand
ObservableRelayCommand(Action< object > execute, Predicate< object > canExecute)
Creates a new observable command.
Definition: ObservableRelayCommand.cs:22
System
Microscopic_Traffic_Simulator.RelayCommand
Command class for binding UI commands with view models.
Definition: RelayCommand.cs:10
Microscopic_Traffic_Simulator.ObservableRelayCommand.CommandExecuted
EventHandler CommandExecuted
Event handler of events executing after finishing command action
Definition: ObservableRelayCommand.cs:28
Microscopic_Traffic_Simulator.ObservableRelayCommand.ObservableRelayCommand
ObservableRelayCommand(Action< object > execute)
Creates a new observable command that can always execute.
Definition: ObservableRelayCommand.cs:15
Microscopic_Traffic_Simulator
Definition: App.xaml.cs:12
Microscopic_Traffic_Simulator.ObservableRelayCommand
Extended relay command class by adding event after executing command. Useful for performing additiona...
Definition: ObservableRelayCommand.cs:9
Microscopic_Traffic_Simulator.ObservableRelayCommand.Execute
override void Execute(object parameter)
Execute action and then fire CommandExecuted event.
Definition: ObservableRelayCommand.cs:34