I'm using the MSIE `WebBrowser` control in a C# desktop application and am looking for a way to build and maintain trees of `HtmlElement` objects outside of this control. I am trying to quickly switch between multiple complex pages without incurring the overhead of re-parsing the HTML each time (and I don't want to maintain multiple controls that are shown/hidden as needed).
I discovered that a) I can only create `HtmlElement` objects via the control's `HtmlDocument` and b) once I remove a "trunk" of `HtmlElement` objects from the control's `HtmlDocument`, it "dies off," even though I keep maintaining a strong reference to the root element.
How can I do this?
P.S. I am willing to consider alternative browser controls (e.g. Gecko) if they allow me to accomplish the above.