using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using Aitex.Common.Util;
using Aitex.Core.UI.MVVM;
using MECF.Framework.Common.IOCore;
using CyberX8_Simulator.Instances;

namespace CyberX8_Simulator.Views
{
    /// <summary>
    /// IoView.xaml 的交互逻辑
    /// </summary>
    public partial class SimulatorIo3View : UserControl
    {
        public SimulatorIo3View()
        {
            InitializeComponent();
            DataContext = new IoViewModel(6733, "PMC.PLC", PathManager.GetCfgDir() + $"_ioDefine{SimulatorJetChamber.CurrentPMCChamber}.xml", "PMC");

            this.IsVisibleChanged += IOView_IsVisibleChanged;
        }

        private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.DataContext == null)
            {
            }
            (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
        }

    }
 
}