0

Currently, I develop a WPF application containing a TabControl to allow the access to each plugin.

Each plugin uses AvalonDock and has different windows which can be docked, floated or hidden.

When I float a window in the plugin1 and after I switch plugin in the plugin2, the floated window disappears (that is normal) but I would like the floated window of the plugin1 does not disappear when I switch in the plugin2 (like the following screen).

step 1:

enter image description here

step 2:

enter image description here

step 3:

enter image description here

Current code with the disappearance of the floated window

        <TabControl>
        <TabItem>
            <TabItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Blue" Foreground="Blue" />
                </StackPanel>
            </TabItem.Header>
            <xcad:DockingManager x:Name="DockingManager">
                <xcad:LayoutRoot>
                    <xcad:LayoutPanel Orientation="Horizontal">
                        <xcad:LayoutDocumentPaneGroup Orientation="Vertical" x:Name="ScriptGroup">
                            <xcad:LayoutDocumentPane x:Name="ScriptPanel" PaneName="ScriptPanel">
                                <xcad:LayoutDocument Title="1-1" >
                                    <TextBlock Text="1-1" Foreground="Blue"  />
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-2">
                                    <TextBlock Text="1-2" Foreground="Blue" />
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-3">
                                    <TextBlock Text="1-2" Foreground="Blue" />
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-4">
                                    <TextBlock Text="1-2" Foreground="Blue" />
                                </xcad:LayoutDocument>
                            </xcad:LayoutDocumentPane>
                        </xcad:LayoutDocumentPaneGroup>
                    </xcad:LayoutPanel>
                </xcad:LayoutRoot>
            </xcad:DockingManager>
        </TabItem>
        <TabItem>
            <TabItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Red" Foreground="Red" />
                </StackPanel>
            </TabItem.Header>
            <xcad:DockingManager x:Name="DockingManager2">
                <xcad:LayoutRoot>
                    <xcad:LayoutPanel Orientation="Horizontal">
                        <xcad:LayoutDocumentPaneGroup Orientation="Vertical" x:Name="ScriptGroup2qdrgqr">
                            <xcad:LayoutDocumentPane x:Name="ScriptPanel2qrgtqr" PaneName="ScriptPanel">
                                <xcad:LayoutDocument Title="1-1">
                                    <TextBlock Text="1-1"  Foreground="Red" />
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-2">
                                    <TextBlock Text="1-2" Foreground="Red"/>
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-3">
                                    <TextBlock Text="1-2" Foreground="Red"/>
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-4">
                                    <TextBlock Text="1-2" Foreground="Red"/>
                                </xcad:LayoutDocument>
                            </xcad:LayoutDocumentPane>
                        </xcad:LayoutDocumentPaneGroup>
                    </xcad:LayoutPanel>
                </xcad:LayoutRoot>
            </xcad:DockingManager>
        </TabItem>
        <TabItem>
            <TabItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Green" Foreground="Green" />
                </StackPanel>
            </TabItem.Header>
            <xcad:DockingManager x:Name="DockingManager3">
                <xcad:LayoutRoot>
                    <xcad:LayoutPanel Orientation="Horizontal">

                        <xcad:LayoutDocumentPaneGroup Orientation="Vertical" x:Name="ScriptGroup3">
                            <xcad:LayoutDocumentPane x:Name="ScriptPanel3" PaneName="ScriptPanel">
                                <xcad:LayoutDocument Title="1-1">
                                    <TextBlock Text="1-1" Foreground="Green" />
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-2">
                                    <TextBlock Text="1-2" Foreground="Green"/>
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-3">
                                    <TextBlock Text="1-2" Foreground="Green"/>
                                </xcad:LayoutDocument>
                                <xcad:LayoutDocument Title="1-4">
                                    <TextBlock Text="1-2" Foreground="Green"/>
                                </xcad:LayoutDocument>
                            </xcad:LayoutDocumentPane>
                        </xcad:LayoutDocumentPaneGroup>
                    </xcad:LayoutPanel>
                </xcad:LayoutRoot>
            </xcad:DockingManager>
        </TabItem>
    </TabControl>

Is it possible to do this by kept the current mechanism ? (with Tabcontrol & Avalondock)

If the answer is no, can you say me what is the best way to do this please ?

Proutatis
  • 75
  • 7
  • I think it's not going to work out with TabControl. Only the currently selected TabItem content is loaded to the controls content area. You should probably manage your popups somewhere up the tree or actually create toolbox windows instead of popups, if you want them to last for a longer time. – grek40 Jun 08 '17 at 11:30
  • why are you using tab controls when avalon dock provides everything for that ? if each plugin create a viewmodel, you bind to document collection, and it's done – GCamel Jun 08 '17 at 12:34

0 Answers0