using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace ConfigEditor { /// /// MainWindow.xaml 的互動邏輯 /// public partial class MainWindow : Window { public static MainWindow Instance { get; private set; } public MainWindow() { Instance = this; InitializeComponent(); uxMainTabControl.SelectionChanged += TabControl_SelectionChanged; } private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (! (sender is TabControl) || ! (e.AddedItems.Count > 0 && e.AddedItems[0] is TabItem)) { return; } var tabControl = sender as TabControl; if (tabControl.SelectedIndex == 0) { uxEvseConfigPanel.Reset(); } if (tabControl.SelectedIndex == 1) { uxAppConfigPanel.Reset(); } } } }