private void Recorder_Loaded(object sender, RoutedEventArgs e) { #region If Snapshot if (UserSettings.All.SnapshotMode) { EnableSnapshot_Executed(null, null); } #endregion #region Timer _garbageTimer.Interval = 3000; _garbageTimer.Elapsed += GarbageTimer_Tick; _garbageTimer.Start(); #endregion CommandManager.InvalidateRequerySuggested(); SystemEvents.PowerModeChanged += System_PowerModeChanged; SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; RecordPauseButton.Focus(); }
private async void Recorder_OnLoaded(object sender, RoutedEventArgs e) { #region Location if (Math.Abs(Settings.Default.RecorderLeft - -1) < 0.5) { Settings.Default.RecorderLeft = (SystemParameters.WorkArea.Width - SystemParameters.WorkArea.Left - Width) / 2; } if (Math.Abs(Settings.Default.RecorderTop - -1) < 0.5) { Settings.Default.RecorderTop = (SystemParameters.WorkArea.Height - SystemParameters.WorkArea.Top - Height) / 2; } if (Settings.Default.RecorderLeft > SystemParameters.WorkArea.Width) { Settings.Default.RecorderLeft = SystemParameters.WorkArea.Width - 100; } if (Settings.Default.RecorderTop > SystemParameters.WorkArea.Height) { Settings.Default.RecorderTop = SystemParameters.WorkArea.Height - 100; } #endregion #region If Snapshot if (Settings.Default.Snapshot) { EnableSnapshot_Executed(null, null); } #endregion await Task.Factory.StartNew(UpdateScreenDpi); _thisWindow = new WindowInteropHelper(this).Handle; #region Timer _garbageTimer.Interval = 3000; _garbageTimer.Elapsed += GarbageTimer_Tick; _garbageTimer.Start(); #endregion //If fullscreen. if (Settings.Default.FullScreen) { _wasThin = false; EnableFullScreen_Executed(null, null); } CommandManager.InvalidateRequerySuggested(); SystemEvents.PowerModeChanged += System_PowerModeChanged; RecordPauseButton.Focus(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { UpdateSize(); UpdateLocation(); #region Adjust the position //Tries to adjust the position/size of the window, centers on screen otherwise. if (!UpdatePositioning(true)) { WindowStartupLocation = WindowStartupLocation.CenterScreen; } #endregion #region If Snapshot if (UserSettings.All.SnapshotMode) { EnableSnapshot_Executed(null, null); } #endregion #region Timers _garbageTimer.Interval = 3000; _garbageTimer.Elapsed += GarbageTimer_Tick; _garbageTimer.Start(); _showBorderTimer.Interval = 500; _showBorderTimer.Tick += ShowBorderTimer_Tick; _followTimer.Tick += FollowTimer_Tick; #endregion CommandManager.InvalidateRequerySuggested(); SystemEvents.PowerModeChanged += System_PowerModeChanged; SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; RecordPauseButton.Focus(); }
private async void Recorder_OnLoaded(object sender, RoutedEventArgs e) { #region If Snapshot if (UserSettings.All.SnapshotMode) { EnableSnapshot_Executed(null, null); } #endregion await Task.Factory.StartNew(UpdateScreenDpi); _thisWindow = new WindowInteropHelper(this).Handle; #region Timer _garbageTimer.Interval = 3000; _garbageTimer.Elapsed += GarbageTimer_Tick; _garbageTimer.Start(); #endregion //If fullscreen. if (UserSettings.All.FullScreenMode) { EnableFullScreen_Executed(null, null); //Reset the values. _wasThin = false; _latestPoint = new System.Windows.Point(Math.Round((SystemParameters.WorkArea.Width - SystemParameters.WorkArea.Left - Width) / 2), Math.Round((SystemParameters.WorkArea.Height - SystemParameters.WorkArea.Top - Height) / 2)); } CommandManager.InvalidateRequerySuggested(); SystemEvents.PowerModeChanged += System_PowerModeChanged; RecordPauseButton.Focus(); }