private void RemoveAdorner(Canvas canvas)
 {
     AdornerLayer.GetAdornerLayer(canvas).Remove(Adorner);
     Adorner = null;
 }
        private void CreateAdorner(Canvas canvas, PointEx origin, PointEx point)
        {
            Adorner = new SelectionAdorner(canvas);
            Adorner.Zoom = GetZoomScaleTransform().ScaleX;
            Adorner.SelectionOrigin = new Point(origin.X, origin.Y);
            Adorner.SelectionRect = new RectEx(origin.X, origin.Y, point.X, point.Y);
            Adorner.SnapsToDevicePixels = false;

            RenderOptions.SetEdgeMode(Adorner, EdgeMode.Aliased);
            AdornerLayer.GetAdornerLayer(canvas).Add(Adorner);
            Adorner.InvalidateVisual();
        }