mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-25 23:30:10 +00:00
59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|||
|
|
|||
|
namespace MSFSPopoutPanelManager.WpfApp.ViewModel
|
|||
|
{
|
|||
|
public class PreferencesViewModel : ObservableObject
|
|||
|
{
|
|||
|
public PreferencesViewModel(DataStore dataStore)
|
|||
|
{
|
|||
|
DataStore = dataStore;
|
|||
|
|
|||
|
ApplicationSettingsVisible = true;
|
|||
|
PopOutSettingsVisible = false;
|
|||
|
AutoPopOutSettingsVisible = false;
|
|||
|
TrackIRSettingsVisible = false;
|
|||
|
}
|
|||
|
|
|||
|
public DelegateCommand SectionSelectCommand => new DelegateCommand(OnSectionSelected, CanExecute);
|
|||
|
|
|||
|
public DataStore DataStore { get; private set; }
|
|||
|
|
|||
|
public bool ApplicationSettingsVisible { get; private set; }
|
|||
|
|
|||
|
public bool PopOutSettingsVisible { get; private set; }
|
|||
|
|
|||
|
public bool AutoPopOutSettingsVisible { get; private set; }
|
|||
|
|
|||
|
public bool TrackIRSettingsVisible { get; private set; }
|
|||
|
|
|||
|
private bool CanExecute(object commandParameter)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
private void OnSectionSelected(object commandParameter)
|
|||
|
{
|
|||
|
ApplicationSettingsVisible = false;
|
|||
|
PopOutSettingsVisible = false;
|
|||
|
AutoPopOutSettingsVisible = false;
|
|||
|
TrackIRSettingsVisible = 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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|