WPF FrameworkElement crossing isolation boundary twice

Apr 1, 2009 at 5:01 PM
Heya all,

In my solution my addins were sending a usercontrol over to the host to display in the hosts window. However after the control has been used the host removes the control from it's window. Later on I want to display it again depending on what happens, but the second time the host asks the addin for the user control it always appeared blank.

Just to make sure I wasn't doing anything silly, I went back to the WPFCalculator example and modified it to reflect my situation. I changed the GraphingCalculator class to initialise the 2DSceneInput in it's constructor, save a reference to it, then always return the same reference when the button is clicked:

        public GraphingCalculator()
        {
            _ops = new List<Operation>();
            _//...etc...
            operate = new SceneInput2D();
        }

and in the operate method:

        case "2D Graph":
                    return operate;

Unfortunately it behaves in the same way as my application. It works the first time it crosses the boundary, but subsequent calls draw up a blank control. Is this a known issue or am I doing something wrong? Any help is appreciated.

Thanks,
Nym.
Apr 1, 2009 at 5:27 PM
I have to do the same thing.  In my addin host I keep a list of objects that hold a reference to essential things in each addin such as the addin's AddInToken and WPF control (FrameworkElement).

--Stephen