private void Window_Activated(object sender, EventArgs e)
 {
     if (!Settings.Default.PopupOnFinish)
     {
         TaskbarUtility.StopFlash(interopHelper.Handle);
     }
 }
 private void MainTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     if (MainTextBox.Text == "Timer expired")
     {
         MainTextBox.Text = ToString(Settings.Default.LastTimeSpan.Ticks < 0 ? TimeSpan.Zero : Settings.Default.LastTimeSpan);
     }
     MainTextBox.SelectAll();
     TaskbarUtility.StopFlash(interopHelper.Handle);
 }
        private void StopNotificationButton_Click(object sender, RoutedEventArgs e)
        {
            if (notification != null)
            {
                notification.Stop();
                notification = null;

                StopNotificationButton.Visibility = System.Windows.Visibility.Collapsed;
                TaskbarUtility.StopFlash(interopHelper.Handle);
            }
            ;
        }
        private void StopNotificationButton_Click(object sender, RoutedEventArgs e)
        {
            if (notification != null)
            {
                notification.Stop();
                notification = null;

                StopNotificationButton.Visibility = Visibility.Collapsed;

                if (MainTextBox.Text == "Timer expired")
                {
                    MainTextBox.Text = ToString(Settings.Default.LastTimeSpan.Ticks < 0 ? TimeSpan.Zero : Settings.Default.LastTimeSpan);
                }
                MainTextBox.SelectAll();
                MainTextBox.Focus();

                TaskbarUtility.StopFlash(interopHelper.Handle);
            }
        }
 private void Window_KeyUp(object sender, KeyEventArgs e)
 {
     TaskbarUtility.StopFlash(interopHelper.Handle);
 }
 private void Window_MouseUp(object sender, MouseButtonEventArgs e)
 {
     TaskbarUtility.StopFlash(interopHelper.Handle);
 }
 private void Window_Deactivated(object sender, EventArgs e)
 {
     TaskbarUtility.StopFlash(interopHelper.Handle);
 }
 private void MainTextBox_GotFocus(object sender, RoutedEventArgs e)
 {
     MainTextBox.SelectAll();
     TaskbarUtility.StopFlash(interopHelper.Handle);
 }