2022-07-23 19:23:32 +00:00
|
|
|
|
using MSFSPopoutPanelManager.Orchestration;
|
|
|
|
|
using MSFSPopoutPanelManager.Shared;
|
|
|
|
|
using Prism.Commands;
|
2022-09-06 04:07:03 +00:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2022-09-06 04:07:03 +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
|
|
|
|
|
2022-09-06 04:07:03 +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;
|
2022-09-06 04:07:03 +00:00
|
|
|
|
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;
|
2022-09-06 04:07:03 +00:00
|
|
|
|
case "Windowed Mode Settings":
|
|
|
|
|
WindowedModeSettingsVisible = true;
|
|
|
|
|
break;
|
2022-06-30 23:53:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|