Esempio n. 1
0
 private void OnRenderToCanvasChanged()
 {
     if (grid == null)
     {
         return;
     }
     if (RenderToCanvas)
     {
         if (canvas == null)
         {
             canvas = new Canvas();
             grid.Children.Insert(0, canvas);
             canvas.UpdateLayout();
         }
         if (plotFrame != null)
         {
             grid.Children.Remove(plotFrame);
             grid.Children.Remove(plotAliasedFrame);
             plotFrame        = null;
             plotAliasedFrame = null;
         }
     }
     else
     {
         if (plotFrame == null)
         {
             plotAliasedFrame = new PlotFrame(true);
             plotFrame        = new PlotFrame(false);
             grid.Children.Insert(0, plotAliasedFrame);
             grid.Children.Insert(1, plotFrame);
             plotFrame.UpdateLayout();
             plotAliasedFrame.UpdateLayout();
         }
         if (canvas != null)
         {
             grid.Children.Remove(canvas);
             canvas = null;
         }
     }
     UpdateVisuals();
 }
Esempio n. 2
0
 private void OnRenderToCanvasChanged()
 {
     if (grid == null)
         return;
     if (RenderToCanvas)
     {
         if (canvas == null)
         {
             canvas = new Canvas();
             grid.Children.Insert(0, canvas);
             canvas.UpdateLayout();
         }
         if (plotFrame != null)
         {
             grid.Children.Remove(plotFrame);
             grid.Children.Remove(plotAliasedFrame);
             plotFrame = null;
             plotAliasedFrame = null;
         }
     }
     else
     {
         if (plotFrame == null)
         {
             plotAliasedFrame = new PlotFrame(true);
             plotFrame = new PlotFrame(false);
             grid.Children.Insert(0, plotAliasedFrame);
             grid.Children.Insert(1, plotFrame);
             plotFrame.UpdateLayout();
             plotAliasedFrame.UpdateLayout();
         }
         if (canvas != null)
         {
             grid.Children.Remove(canvas);
             canvas = null;
         }
     }
     UpdateVisuals();
 }