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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using Inspectron.Settings;
|
||||
using Ninject;
|
||||
using Ninject.Extensions.ChildKernel;
|
||||
using VisionBuilder.UI.Common.ViewModel;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
|
||||
namespace VisionBuilder.UI.Common;
|
||||
@@ -17,6 +18,7 @@ public static class VisionBuilder
|
||||
mainKernel.Bind<ILearningTool>().To<NoLearning>().InSingletonScope();
|
||||
// --- //
|
||||
|
||||
mainKernel.Bind<MainWindowVM>().ToSelf().InSingletonScope();
|
||||
return mainKernel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user