1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-12-01 18:20:10 +00:00
msfs-popout-panel-manager/WpfApp/ViewModel/PreferencesViewModel.cs

81 lines
2.7 KiB
C#
Raw Normal View History

2022-07-23 19:23:32 +00:00
using MSFSPopoutPanelManager.Orchestration;
using MSFSPopoutPanelManager.Shared;
using Prism.Commands;
using System.Windows;
2022-06-30 23:53:08 +00:00
namespace MSFSPopoutPanelManager.WpfApp.ViewModel
{
public class PreferencesViewModel : ObservableObject
{
2022-07-23 19:23:32 +00:00
private MainOrchestrator _orchestrator;
public PreferencesViewModel(MainOrchestrator orchestrator)
2022-06-30 23:53:08 +00:00
{
2022-07-23 19:23:32 +00:00
_orchestrator = orchestrator;
2022-06-30 23:53:08 +00:00
ApplicationSettingsVisible = true;
PopOutSettingsVisible = false;
AutoPopOutSettingsVisible = false;
TrackIRSettingsVisible = false;
2022-07-23 19:23:32 +00:00
SectionSelectCommand = new DelegateCommand<object>(OnSectionSelected);
2022-06-30 23:53:08 +00:00
}
public Window Window { get; set; }
2022-07-23 19:23:32 +00:00
public DelegateCommand<object> SectionSelectCommand { get; private set; }
2022-06-30 23:53:08 +00:00
2022-07-23 19:23:32 +00:00
public AppSettingData AppSettingData { get { return _orchestrator.AppSettingData; } }
2022-06-30 23:53:08 +00:00
public bool ApplicationSettingsVisible { get; private set; }
public bool PopOutSettingsVisible { get; private set; }
public bool AutoPopOutSettingsVisible { get; private set; }
public bool TrackIRSettingsVisible { get; private set; }
2022-07-23 19:23:32 +00:00
public bool TouchSettingsVisible { get; private set; }
public bool MSFSTouchPanelSettingsVisible { get; private set; }
2022-06-30 23:53:08 +00:00
public bool WindowedModeSettingsVisible { get; private set; }
2022-06-30 23:53:08 +00:00
private void OnSectionSelected(object commandParameter)
{
ApplicationSettingsVisible = false;
PopOutSettingsVisible = false;
AutoPopOutSettingsVisible = false;
TrackIRSettingsVisible = false;
2022-07-23 19:23:32 +00:00
TouchSettingsVisible = false;
MSFSTouchPanelSettingsVisible = false;
WindowedModeSettingsVisible = false;
2022-06-30 23:53:08 +00:00
switch (commandParameter.ToString())
{
case "Application Settings":
ApplicationSettingsVisible = true;
break;
case "Pop Out Settings":
PopOutSettingsVisible = true;
break;
case "Auto Pop Out Panel Settings":
AutoPopOutSettingsVisible = true;
break;
case "Track IR Settings":
TrackIRSettingsVisible = true;
break;
2022-07-23 19:23:32 +00:00
case "Touch Settings":
TouchSettingsVisible = true;
break;
case "MSFS Touch Panel Settings":
MSFSTouchPanelSettingsVisible = true;
break;
case "Windowed Mode Settings":
WindowedModeSettingsVisible = true;
break;
2022-06-30 23:53:08 +00:00
}
}
}
}