private void DrawingArea_MouseDown(object sender, MouseButtonEventArgs e) { if (IsCurrentState(drawingState.CreateNewBounds) && e.RightButton == MouseButtonState.Pressed && NotCurrentState(drawingState.PanView)) { currentState = drawingState.RightClickOnCreateBounds; _DrawingStateHandler.OnDrawingChangeInvoker(currentState); } else if (IsCurrentState(drawingState.CreateNewBounds)) { startingPoint = e.GetPosition(DrawingArea); // Creating and tracking a new Zone currentZone = new ResizeZone(); currentZone.Opacity = .65; Canvas.SetLeft(currentZone, startingPoint.X); Canvas.SetTop(currentZone, startingPoint.Y); DrawingArea.Children.Add(currentZone); currentZone.number = DrawingArea.Children.Count; subToInvoker(currentZone); } }
private void subToInvoker(ResizeZone x) { x.myInvoker.OnDroppedDelegate += myInvoker_AfterAnItemHasBeenDroppedFeedBack; }
private void DrawingArea_MouseUp(object sender, MouseButtonEventArgs e) { if (IsCurrentState(drawingState.CreateNewBounds)) { if (currentZone != null) { currentZone.IsEnabled = true; _DrawingStateHandler.DrawingStateChange += currentZone.AdjustingDrawingState; } } if (IsCurrentState(drawingState.RightClickOnCreateBounds)) { currentState = drawingState.CreateNewBounds; _DrawingStateHandler.OnDrawingChangeInvoker(currentState); } currentZone = null; startingPoint = new Point(); }