1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 05:40:11 +00:00
msfs-popout-panel-manager/WpfApp/ViewModel/PreferencesViewModel.cs
Stanley 43caff1ca9 Squashed commit of the following:
commit 2bbda3c4e4969fdf05566908fde01f1c9e4e23f7
Author: Stanley <hawkeyesk@outlook.com>
Date:   Mon Sep 5 23:54:39 2022 -0400

    Added in-game panel support

commit ec29b0ec2612b10e45ab9a73c10b88a98fcf6eaf
Author: Stanley <hawkeyesk@outlook.com>
Date:   Sun Sep 4 21:21:37 2022 -0400

    Added in-game panel support

commit 97edc184f349e1fde74a15a643fb90fb9bd90395
Author: Stanley <hawkeyesk@outlook.com>
Date:   Thu Sep 1 18:08:44 2022 -0400

    Update touch panel

commit da48ca0a272290466952c5c1bd1ca035d56f930c
Author: Stanley <hawkeyesk@outlook.com>
Date:   Mon Aug 29 22:19:38 2022 -0400

    Added pop out panel temporary display

commit 701346193804f93616b0e6e2222d9d55223f516f
Author: Stanley <hawkeyesk@outlook.com>
Date:   Wed Aug 24 10:33:59 2022 -0400

    Added auto resize window display mode

commit 98cbcd949f1555b44db22267ce5c54858bef47cd
Author: Stanley <hawkeyesk@outlook.com>
Date:   Wed Aug 24 09:39:38 2022 -0400

    Added auto resize window display mode
2022-09-06 00:07:03 -04:00

80 lines
2.7 KiB
C#

using MSFSPopoutPanelManager.Orchestration;
using MSFSPopoutPanelManager.Shared;
using Prism.Commands;
using System.Windows;
namespace MSFSPopoutPanelManager.WpfApp.ViewModel
{
public class PreferencesViewModel : ObservableObject
{
private MainOrchestrator _orchestrator;
public PreferencesViewModel(MainOrchestrator orchestrator)
{
_orchestrator = orchestrator;
ApplicationSettingsVisible = true;
PopOutSettingsVisible = false;
AutoPopOutSettingsVisible = false;
TrackIRSettingsVisible = false;
SectionSelectCommand = new DelegateCommand<object>(OnSectionSelected);
}
public Window Window { get; set; }
public DelegateCommand<object> SectionSelectCommand { get; private set; }
public AppSettingData AppSettingData { get { return _orchestrator.AppSettingData; } }
public bool ApplicationSettingsVisible { get; private set; }
public bool PopOutSettingsVisible { get; private set; }
public bool AutoPopOutSettingsVisible { get; private set; }
public bool TrackIRSettingsVisible { get; private set; }
public bool TouchSettingsVisible { get; private set; }
public bool MSFSTouchPanelSettingsVisible { get; private set; }
public bool WindowedModeSettingsVisible { get; private set; }
private void OnSectionSelected(object commandParameter)
{
ApplicationSettingsVisible = false;
PopOutSettingsVisible = false;
AutoPopOutSettingsVisible = false;
TrackIRSettingsVisible = false;
TouchSettingsVisible = false;
MSFSTouchPanelSettingsVisible = false;
WindowedModeSettingsVisible = false;
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;
case "Touch Settings":
TouchSettingsVisible = true;
break;
case "MSFS Touch Panel Settings":
MSFSTouchPanelSettingsVisible = true;
break;
case "Windowed Mode Settings":
WindowedModeSettingsVisible = true;
break;
}
}
}
}