io commander
This commit is contained in:
@@ -10,7 +10,12 @@ namespace VisionBuilder.UI.Common.ViewModel;
|
||||
public partial class MainWindowVM:ObservableObject
|
||||
{
|
||||
private readonly ISettingsService _settingsService;
|
||||
|
||||
public event Action ProgramStarted = delegate { };
|
||||
public event Action ProgramClosed = delegate { };
|
||||
public event Action<bool> TestModeChanged = delegate { };
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _testMode;
|
||||
|
||||
public MainWindowVM(ISettingsService settingsService)
|
||||
{
|
||||
@@ -27,4 +32,21 @@ public partial class MainWindowVM:ObservableObject
|
||||
_settingsService.ShowSettingsDialog();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public void ToggleTestMode()
|
||||
{
|
||||
TestMode = !TestMode;
|
||||
TestModeChanged(TestMode);
|
||||
}
|
||||
|
||||
public void OnProgramStarted()
|
||||
{
|
||||
ProgramStarted?.Invoke();
|
||||
}
|
||||
|
||||
public void OnProgramClosed()
|
||||
{
|
||||
ProgramClosed?.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user