using System.Windows; using System.Windows.Controls; using Aitex.Core.UI.MVVM; using Aitex.Core.UI.View.Common; using Aitex.Sorter.UI.ViewModel; namespace EfemUI.Views { /// /// SystemConfigView.xaml 的交互逻辑 /// public partial class SystemConfigView2LP : UserControl, IBaseView { public SystemConfigView2LP() { InitializeComponent(); this.DataContext = new SystemConfigViewModel2LP(); this.IsVisibleChanged += ProcessConfigView_IsVisibleChanged; } void ProcessConfigView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (IsVisible) (this.DataContext as SystemConfigViewModel2LP).UpdateConfig(); (this.DataContext as TimerViewModelBase).EnableTimer(this.IsVisible); } } }