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(OnSectionSelected); } public Window Window { get; set; } public DelegateCommand 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; } } } }