12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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();
- if (VersionNo == "005")
- {
- DataContext = new IoViewModelBase(16731, "System.dio000",
- PathManager.GetCfgDir() + "_ioDefine2.xml");
- }
- else
- {
- DataContext = new IoViewModelBase(16731, "System.dio000",
- PathManager.GetCfgDir() + "_ioDefine1.xml");
- }
- this.IsVisibleChanged += IOView_IsVisibleChanged;
- }
- private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- {
- if (this.DataContext == null)
- {
- }
- (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
- }
- }
- }
|