private void HandleIconMouseDown(object sender, MouseButtonEventArgs e) { switch (e.ChangedButton) { case MouseButton.Left: if (e.ClickCount == 1) { e.Handled = true; WindowSteeringHelper.ShowSystemMenu(this, this.PointToScreen(new Point(0, this.TitleBarHeight))); } else if (e.ClickCount == 2) { e.Handled = true; #pragma warning disable 618 ControlzEx.Windows.Shell.SystemCommands.CloseWindow(this); #pragma warning restore 618 } break; case MouseButton.Right: e.Handled = true; WindowSteeringHelper.ShowSystemMenu(this, e); break; } }
private void HandleIconMouseDown(object sender, MouseButtonEventArgs e) { switch (e.ChangedButton) { case MouseButton.Left: if (e.ClickCount == 1) { e.Handled = true; WindowSteeringHelper.ShowSystemMenuPhysicalCoordinates(this, e, this.PointToScreen(new Point(0, this.TitleBarHeight))); } else if (e.ClickCount == 2) { e.Handled = true; this.Close(); } break; case MouseButton.Right: e.Handled = true; this.RunInDispatcherAsync(() => WindowSteeringHelper.ShowSystemMenuPhysicalCoordinates(this, e)); break; } }
/// <summary> /// Invoked when an unhandled <see cref="E:System.Windows.UIElement.MouseRightButtonUp"/> routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// </summary> /// <param name="e">The <see cref="T:System.Windows.Input.MouseButtonEventArgs"/> that contains the event data. The event data reports that the right mouse button was released.</param> protected override void OnMouseRightButtonUp(MouseButtonEventArgs e) { base.OnMouseRightButtonUp(e); if (this.IsEnabled) { WindowSteeringHelper.ShowSystemMenuPhysicalCoordinates(this, e); } }
/// <summary> /// Invoked when an unhandled <see cref="E:System.Windows.UIElement.MouseLeftButtonDown"/> routed event is raised on this element. Implement this method to add class handling for this event. /// </summary> /// <param name="e">The <see cref="T:System.Windows.Input.MouseButtonEventArgs"/> that contains the event data. The event data reports that the left mouse button was pressed.</param> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); if (this.IsEnabled) { WindowSteeringHelper.HandleMouseLeftButtonDown(e, true, true); } }
/// <inheritdoc /> protected override void OnMouseRightButtonUp(MouseButtonEventArgs e) { base.OnMouseRightButtonUp(e); if (e.Handled || this.IsMouseDirectlyOver == false) { return; } WindowSteeringHelper.ShowSystemMenu(this, e); }
/// <inheritdoc /> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); if (e.Handled) { return; } // Contextual groups shall handle mouse events if (e.Source is RibbonContextualGroupsContainer || e.Source is RibbonContextualTabGroup) { return; } WindowSteeringHelper.HandleMouseLeftButtonDown(e, true, true); }
/// <inheritdoc /> protected override void OnMouseRightButtonDown(MouseButtonEventArgs e) { base.OnMouseRightButtonDown(e); WindowSteeringHelper.ShowSystemMenu(this, e); }
/// <summary> /// Raises the MouseDoubleClick routed event /// </summary> /// <param name="e">The event data</param> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); WindowSteeringHelper.HandleMouseLeftButtonDown(e, false, true); }