private void OnCanvasViewIsHighQualityScalingEnabledChanged(object sender, ValueChangedEventArgs <bool> e)
 {
     if (!base.CheckAccess())
     {
         PaintDotNet.Canvas.Canvas owner = base.Owner;
         if ((owner != null) && (owner.Dispatcher != null))
         {
             try
             {
                 object[] args = new object[] { sender, e };
                 base.Owner.Dispatcher.BeginInvoke(new Action <object, ValueChangedEventArgs <bool> >(this.OnCanvasViewIsHighQualityScalingEnabledChanged), args);
             }
             catch (Exception)
             {
             }
         }
     }
     else if (!base.IsDisposed)
     {
         CanvasView key = (CanvasView)sender;
         if (this.documentCanvasLayerViews.ContainsKey(key))
         {
             this.RecreateDocumentCanvasLayerView(key);
             key.Invalidate(key.GetCanvasBounds());
         }
     }
 }
        private static void OnIsPixelGridEnabledPropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
        {
            CanvasView canvasView = (CanvasView)target;

            canvasView.Invalidate(canvasView.GetCanvasBounds());
            RaiseIsPixelGridEnabledChanged(canvasView, e);
        }