private void CompendiumMapDepthMap_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { _isLeftMouseButtonDown = true; _selectionStartPoint = translateTransform.Inverse.Transform(e.GetPosition(this)); _selectionStartPoint = scaleTransform.Inverse.Transform(_selectionStartPoint); if (_selectionRectangle != null) { this.uxMapSurface.Children.Remove(_selectionRectangle); _selectionRectangle = null; } if (e.ClickCount != 2) { _selectionRectangle = new Rectangle(); _selectionRectangle.Stroke = new SolidColorBrush(Colors.Black); _selectionRectangle.StrokeThickness = 1.0; _selectionRectangle.Opacity = 0.7; DoubleCollection dashArray = new DoubleCollection(); dashArray.Add(2); dashArray.Add(4); _selectionRectangle.StrokeDashArray = dashArray; _selectionRectangle.SetValue(Canvas.LeftProperty, _selectionStartPoint.X); _selectionRectangle.SetValue(Canvas.TopProperty, _selectionStartPoint.Y); this.uxMapSurface.Children.Add(_selectionRectangle); } ViewManager.CommitNodeName(); }