Pass Reference to WPFelementHost

Hi, in the Example given by Dale Fugier ( to add a Wpf window to a Plugin, how do you pass the RhinoDoc reference to the WpfWindow?
could you give an implemented version please?
you take from the class SampleCsWpfPanelCommand the RhinoDoc doc reference from the RunCommand and it has to be given to the SampleCsWpfUserControl.xaml .
How to Implement It?

Hi Markus,

Anytime your panel needs the active document, it can just call Rhino.RhinoDoc.ActiveDoc. Does this help?

– Dale

SWEET! I was just posting the exact same question!

    Bgr col = new Bgr(System.Drawing.Color.Red);        
    foreach(CircleF circ in circles){
        Img.Draw(circ, col, 3);
        Circle circle = new Circle(new Point3d(circ.Center.X, circ.Center.Y, 0), circ.Radius);