private static void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (e.OriginalSource == sender && e.Key == Key.Space)
            {
                // ignore alt + space which invokes the system menu
                if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
                {
                    return;
                }

                VirtualToggleButton.UpdateIsChecked((DependencyObject)sender);
                e.Handled = true;
            }
        }
 private static void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     e.Handled = true;
     VirtualToggleButton.UpdateIsChecked((DependencyObject)sender);
 }