mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-25 15:20:10 +00:00
66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
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;
|
|
TrackIRSettingsVisibility = Visibility.Collapsed;
|
|
}
|
|
|
|
public AppSetting AppSetting { get; set; }
|
|
|
|
public Visibility ApplicationSettingsVisibility { get; set; }
|
|
|
|
public Visibility PopOutSettingsVisibility { get; set; }
|
|
|
|
public Visibility AutoPopOutSettingsVisibility { get; set; }
|
|
|
|
public Visibility TrackIRSettingsVisibility { get; set; }
|
|
|
|
private void TreeViewItem_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
var treeViewItem = (TreeViewItem)e.Source;
|
|
|
|
ApplicationSettingsVisibility = Visibility.Collapsed;
|
|
PopOutSettingsVisibility = Visibility.Collapsed;
|
|
AutoPopOutSettingsVisibility = Visibility.Collapsed;
|
|
TrackIRSettingsVisibility = Visibility.Collapsed;
|
|
|
|
if (treeViewItem.Header.ToString() == "Application Settings")
|
|
{
|
|
ApplicationSettingsVisibility = Visibility.Visible;
|
|
}
|
|
else if(treeViewItem.Header.ToString() == "Pop Out Settings")
|
|
{
|
|
PopOutSettingsVisibility = Visibility.Visible;
|
|
}
|
|
else if (treeViewItem.Header.ToString() == "Auto Pop Out Panel Settings")
|
|
{
|
|
AutoPopOutSettingsVisibility = Visibility.Visible;
|
|
}
|
|
else if (treeViewItem.Header.ToString() == "Track IR Settings")
|
|
{
|
|
TrackIRSettingsVisibility = Visibility.Visible;
|
|
}
|
|
}
|
|
}
|
|
}
|