12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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
- {
- /// <summary>
- /// MainWindow.xaml 的互動邏輯
- /// </summary>
- 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();
- }
- }
- }
- }
|