void ResultDataListView3_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { _vm = this.DataContext as NovaAlert.Config.ViewModels.ResultDataListViewModel3; if (_vm != null) { _timer = new Timer(10000) { Enabled = true }; _timer.Elapsed += _timer_Elapsed; } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); ThemeManager.ApplicationThemeName = Theme.TouchlineDark.Name; // Theme.HybridApp.Name; Window wnd; NovaAlert.Config.ViewModels.ResultDataListViewModelBase vm; var st = NovaAlert.ResultViewer.Properties.Settings.Default; if (st.ViewStyle == 3) { wnd = new NovaAlert.Config.Views.ResultDataListView3(); wnd.FontSize = st.FontSize_3; vm = new NovaAlert.Config.ViewModels.ResultDataListViewModel3(); } else { wnd = new NovaAlert.Config.Views.ResultDataListView2(); vm = new NovaAlert.Config.ViewModels.ResultDataListViewModel2(); } wnd.DataContext = vm; if (Screen.AllScreens.Length > 0) { Screen s1 = Screen.AllScreens[Screen.AllScreens.Length - 1]; Rectangle r1 = s1.WorkingArea; wnd.Top = r1.Top; wnd.Left = r1.Left; wnd.Width = r1.Width; wnd.Height = r1.Height; } else { wnd.WindowState = WindowState.Maximized; } wnd.Show(); }