private void ElementResizer_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { editingStartposition = e.GetPosition(this); var resizer = (sender as Grid); var parent = resizer.Parent as Grid; var note = (Note)(parent).Tag; if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { editingElements.Add(note); editingVisualElements.Add(parent); } else { editingElements = new List <Note> { note }; editingVisualElements = new List <FrameworkElement> { parent }; } editingType = EditingTypes.Rezise; e.Handled = true; }
private void Element_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { editingStartposition = e.GetPosition(this); editingStarTime = DateTime.Now; var visualElement = (Grid)sender; if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { if (editingVisualElements.Contains(visualElement)) { deselectNote(visualElement); } else { selectNote(visualElement); } } else { clearAllNotesSelection(); selectNote(visualElement); } editingType = EditingTypes.Move; }
private void Page_MouseUp(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) { if (editingType != EditingTypes.None) { moveByMouseMovement(e, true); editingType = EditingTypes.None; } } }