123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.Configuration;
- using System.Windows;
- using System.Windows.Controls;
- using Aitex.Common.Util;
- using Aitex.Core.UI.MVVM;
- namespace EfemSimulator.Views
- {
- /// <summary>
- /// IoView.xaml 的交互逻辑
- /// </summary>
- public partial class SimulatorCard1View : UserControl
- {
- public SimulatorCard1View()
- {
- InitializeComponent();
- var VersionNo = ConfigurationManager.AppSettings["VersionNumber"].ToString();
- switch (VersionNo)
- {
- case "005":
- DataContext = new IoViewModelBase(16731, "System.dio000", PathManager.GetCfgDir() + "_ioDefine2.xml");
- break;
- case "006":
- DataContext = new IoViewModelBase(16731, "System.dio000", PathManager.GetCfgDir() + "_ioDefine3.xml");
- break;
- default:
- DataContext = new IoViewModelBase(16731, "System.dio000", PathManager.GetCfgDir() + "_ioDefine1.xml");
- break;
- }
- this.IsVisibleChanged += IOView_IsVisibleChanged;
- }
- private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- if (this.DataContext == null)
- {
- }
- (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
- }
- }
- }
|