private void HandleButtonPressEvent (object o, MouseButtonEventArgs args) { if (Command != null) Command.Execute (CommandParameter); RaiseClick (); }
private void HandleButtonPressEvent (object sender, MouseButtonEventArgs e) { IsDragging = true; MousePosition = PointToScreen (Mouse.GetPosition (this)); Mouse.Captured = this; }
private void HandleMotionNotifyEvent (object sender, MouseButtonEventArgs e) { if (!IsDragging) return; var previosMousePosition = MousePosition; MousePosition = PointToScreen (Mouse.GetPosition (this)); RaiseDragDelta (MousePosition.X - previosMousePosition.X, MousePosition.Y - previosMousePosition.Y); }
private void HandleProviderButtonPressEvent (object o, MouseButtonEventArgs args) { RaisePreviewButtonPressEvent (args); RaiseButtonPressEvent (args); }
private void HandlePreviewButtonReleaseEvent (object sender, MouseButtonEventArgs e) { var point = Mouse.GetPosition (this); if (point.X < 0 || point.X > Width || point.Y < 0 || point.Y > Height) Close (); }
private void HandleButtonPressEvent (object o, MouseButtonEventArgs args) { if (Mouse.Device.TargetElement != canvas) { documentCursor.Visibility = Visibility.Collapsed; return; } var point = Mouse.GetPosition (this); documentCursor.X = Math.Round (point.X); documentCursor.Y = Math.Round (point.Y); documentCursor.Visibility = Visibility.Visible; }
private void RaiseButtonReleaseEvent (MouseButtonEventArgs args) { if (CapturedTargetElement == null) return; ButtonReleaseEvent.RaiseEvent (CapturedTargetElement, args); }
private void RaiseMotionNotifyEvent (MouseButtonEventArgs args) { if (CapturedTargetElement == null) return; MotionNotifyEvent.RaiseEvent (CapturedTargetElement, args); }
private void RaisePreviewButtonPressEvent (MouseButtonEventArgs args) { if (CapturedTargetElement == null) return; PreviewButtonPressEvent.RaiseEvent (CapturedTargetElement, args); }
private void RaiseButtonPressEvent (MouseButtonEventArgs args) { if (TargetElement == null) return; ButtonPressEvent.RaiseEvent (TargetElement, args); }
private void HandleHeaderPreviewButtonPressEvent (object sender, MouseButtonEventArgs e) { IsSubmenuOpen = !IsSubmenuOpen; }
private void HandlePreviewButtonPressEvent (object o, MouseButtonEventArgs args) { OnPreviewButtonPressEvent (this, args); lookingFocus = true; if (!Focusable || Mouse.Device.TargetElement != this) return; Keyboard.Focus (this); }
private void RaiseMotionNotifyEvent (MouseButtonEventArgs args) { if (MotionNotifyEvent != null) { MotionNotifyEvent (this, args); } }
private void HandleButtonPressEvent (object sender, MouseButtonEventArgs e) { if (lookingFocus && Focusable) { Keyboard.Focus (this); } lookingFocus = false; OnButtonPressEvent (sender, e); }
private void RaiseButtonReleaseEvent (MouseButtonEventArgs args) { if (ButtonReleaseEvent != null) { ButtonReleaseEvent (this, args); } }
private void RaisePreviewButtonPressEvent (MouseButtonEventArgs args) { if (PreviewButtonPressEvent != null) { PreviewButtonPressEvent (this, args); } }
protected virtual void OnMotionNotifyEvent (object o, MouseButtonEventArgs args) { RaiseMotionNotifyEvent (args); }
protected virtual void OnButtonReleaseEvent (object o, MouseButtonEventArgs args) { RaiseButtonReleaseEvent (args); }
protected virtual void OnPreviewButtonPressEvent (object o, MouseButtonEventArgs args) { RaisePreviewButtonPressEvent (args); }
private void HandleButtonReleaseEvent (object sender, MouseButtonEventArgs e) { IsDragging = false; Mouse.Captured = null; }
private void HandleButtonReleaseEvent (object sender, MouseButtonEventArgs e) { RaisePreviewButtonReleaseEvent (e); RaiseButtonReleaseEvent (e); }
private void HandleMotionNotifyEvent (object o, MouseButtonEventArgs args) { var provider = providers.FirstOrDefault (p => p == o); if (provider == null) return; var root = Application.Current.GetRoot (provider.RootElement); if (root == null) return; var point = root.GerMousePosition (); TargetElement = VisualTreeHelper.HitTest (point, provider.RootElement); var eventArgs = new MouseButtonEventArgs (); RaisePreviewMotionNotifyEvent (eventArgs); RaiseMotionNotifyEvent (eventArgs); }
private void HandleButtonPressEvent (object o, MouseButtonEventArgs args) { RaiseClick (); }