How to Active create new document on runtime?

Apr 20, 2009 at 8:57 AM

I have a question about how to set the create new document active in runtime?
when crate a DocumentContent in runtime, i want to it become the default select.
i try to use ActiveDocument/SelectedIndex but seem not effect, the code as:

         AvalonDock.DocumentContent doc = new AvalonDock.DocumentContent;
                doc.Title = select.Title;
                doc.InfoTip = "Info tipo for " + doc.Title;
                doc.ContentTypeDescription = select.Title;
                // doc.Closing += new EventHandler<CancelEventArgs>(doc_Closing);
                //doc.Closed += new EventHandler(doc_Closed);
                docHost.SelectedIndex = docHost.Items.Count - 1;

                mainManager.ActiveDocument = doc;
Is there any one can help me?  

Apr 20, 2009 at 1:40 PM