private void Btn_ChangeMonitor_Click(object sender, RoutedEventArgs e) { if (CB_Monit.SelectedIndex == 0) { App.Setting.NumberLeftMonitor = 1; App.Setting.NumberRightMonitor = 0; } else { App.Setting.NumberLeftMonitor = 0; App.Setting.NumberRightMonitor = 1; } MonitorManager.RestartPositionWindows(); App.Setting.Export(); }
private void Page_Unloaded(object sender, RoutedEventArgs e) { App.MainWnd.StartOrPause = true; App.LaunchMedia -= Btn_Launch_Click; App.StartMedia -= Btn_Start_Click; App.PauseMedia -= Btn_Pause_Click; App.StopMedia -= Btn_Stop_Click; try { ObserverUserActivity.StartActivityObserv(); Action <DispatcherTimer> StopTimer = (t) => { if (t != null) { t.Stop(); } }; Stop(); StopTimer(_timerStart); StopTimer(_timerShift); StopTimer(_timerEnd); MonitorManager.RestartPositionWindows(); App.LockDisplayWindow.Topmost = true; Observer.EndObserv(); App.Repository.AddObserver(_observer); } catch (Exception ex) { App.Logger.Error(DateTime.Now.ToString() + " In Page_Unloaded VideoControllerPage" + ex.Message); } }