Exemplo n.º 1
0
 public FREDrawingVisual(object c)
 {
     this.context = c.Wrap <IFrameworkRenderElementContext>();
     using (var dc = RenderOpen()) {
         context.Render(dc);
         var controls = new[] { context }.Concat(RenderTreeHelper.RenderDescendants(context));
         foreach (var ctrl in controls)
         {
             var rcbc = ctrl.Wrap <IRenderControlBaseContext>();
             if (rcbc == null)
             {
                 continue;
             }
             dc.PushTransform(rcbc.GeneralTransform);
             dc.DrawRectangle(new VisualBrush(rcbc.Control), null, new Rect(new Point(0, 0), rcbc.RenderSize));
             dc.Pop();
         }
         dc.Close();
     }
 }
Exemplo n.º 2
0
 public FREDrawingVisual(object context)
 {
     this.context = context;
     using (var dc = this.RenderOpen()) {
         DXMethods.Render(((dynamic)context).Factory, dc, context);
         var controls = new object[] { context }.Concat(RenderTreeHelper.RenderDescendants(context));
         foreach (object ctrl in controls)
         {
             if (!DXMethods.Is(ctrl, "RenderControlBaseContext", null, false))
             {
                 continue;
             }
             var dctrl = ((dynamic)ctrl);
             dc.PushTransform((dctrl).GeneralTransform);
             dc.DrawRectangle(new VisualBrush((dctrl).Control), null, new Rect(new Point(0, 0), (dctrl).RenderSize));
             dc.Pop();
         }
         dc.Close();
     }
 }