Programmatically adding document windows to a MDI

Docking/MDI for WPF Forum

Posted 15 years ago by dean
I am trying to get a documentwindow to be opened in a multi window container when i click a button.

When i click the button nothing happens even though i can step through the ScreenButton_Click method.

I have implemented this correctly?
        StandardMdiHost MyMDIHost;
        DockSite MyDockSite;
 public override void BeginInit()
            //Create the docking panel
            MyDockSite = CreateApplicationDockSite();

            //Create the WPF docking panel that will be the content of the WPF window.
            DockPanel MyDockPanel = new DockPanel();
            MyDockPanel.LastChildFill = true;

            //Add the docksite and the ribbon.
            //Note: The Actipro Ribbon has to be the last added.  Not sure why - their documentation does not
            //        state why...
            this.ApplicationName = ApplicationInformation.ApplicationTitle;
            this.DocumentName = string.Empty;
            this.Content = MyDockPanel;

        private DockSite CreateApplicationDockSite()
            MyDockSite = new DockSite();
            MyDockSite.Name = "MyDockSite";
            MyDockSite.CanDocumentWindowsClose = false;

            SplitContainer MySplitContainer = new SplitContainer();

            MyMDIHost = new StandardMdiHost();
            MyMDIHost.Name = "MyMDIHost";


            MyDockSite.Content = MySplitContainer;

            return MyDockSite;

        void ScreenButton_Click(object sender, ExecuteRoutedEventArgs e)

                DocumentWindow x = new DocumentWindow(MyDockSite);

            catch (Exception ex)

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Dean,

You need to insert a Workspace between the SplitContainer and the StandardMdiHost. That could possibly be doing it.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.