1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 15:20:10 +00:00
msfs-popout-panel-manager/WpfApp/PreferencesDialog.xaml.cs

67 lines
2.2 KiB
C#
Raw Normal View History

2022-04-18 03:38:33 +00:00
using MahApps.Metro.Controls;
using MSFSPopoutPanelManager.Model;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.WpfApp
{
/// <summary>
/// Interaction logic for AddProfileDialog.xaml
/// </summary>
public partial class PreferencesDialog : MetroWindow, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public PreferencesDialog(AppSetting appSetting)
{
InitializeComponent();
AppSetting = appSetting;
this.DataContext = this;
ApplicationSettingsVisibility = Visibility.Visible;
PopOutSettingsVisibility = Visibility.Collapsed;
AutoPopOutSettingsVisibility = Visibility.Collapsed;
2022-05-04 15:11:04 +00:00
TrackIRSettingsVisibility = Visibility.Collapsed;
2022-04-18 03:38:33 +00:00
}
public AppSetting AppSetting { get; set; }
public Visibility ApplicationSettingsVisibility { get; set; }
public Visibility PopOutSettingsVisibility { get; set; }
public Visibility AutoPopOutSettingsVisibility { get; set; }
2022-05-04 15:11:04 +00:00
public Visibility TrackIRSettingsVisibility { get; set; }
2022-04-18 03:38:33 +00:00
private void TreeViewItem_Selected(object sender, RoutedEventArgs e)
{
var treeViewItem = (TreeViewItem)e.Source;
ApplicationSettingsVisibility = Visibility.Collapsed;
PopOutSettingsVisibility = Visibility.Collapsed;
AutoPopOutSettingsVisibility = Visibility.Collapsed;
2022-05-04 15:11:04 +00:00
TrackIRSettingsVisibility = Visibility.Collapsed;
2022-04-18 03:38:33 +00:00
if (treeViewItem.Header.ToString() == "Application Settings")
{
ApplicationSettingsVisibility = Visibility.Visible;
}
else if(treeViewItem.Header.ToString() == "Pop Out Settings")
{
PopOutSettingsVisibility = Visibility.Visible;
}
2022-04-18 04:52:43 +00:00
else if (treeViewItem.Header.ToString() == "Auto Pop Out Panel Settings")
2022-04-18 03:38:33 +00:00
{
AutoPopOutSettingsVisibility = Visibility.Visible;
}
2022-05-04 15:11:04 +00:00
else if (treeViewItem.Header.ToString() == "Track IR Settings")
{
TrackIRSettingsVisibility = Visibility.Visible;
}
2022-04-18 03:38:33 +00:00
}
}
}