public void ShowBlock(Point pLocation) { if (HighLight) { Canvas.AddRectangle(pLocation.X, pLocation.Y, Width, Height, _Color, 2, Color.Yellow); } else { Canvas.AddRectangle(pLocation.X, pLocation.Y, Width, Height, _Color, 1, Color.Black); } }
public override void MouseUp(MouseEventArgs e) { if (IsDrawing) { IsDrawing = false; // Mouse up means that we want to draw our final result, so we longer need creation shapes. CreationDrawable = null; // The final drawn result. var rectangle = GetRectangle(true); // Add final result to the Canvas. if (rectangle.Width > 0 && rectangle.Height > 0) { Canvas.AddRectangle(rectangle); } RepaintCanvas(); } }