[Avalong Dock 2.0] Docking Manager within a LayoutDocument in LayoutDocumentPane

Jul 9, 2012 at 5:49 PM

Hi all,

I am trying to get a docking manager within each document that is being created.

Each document will act as a scenario, and within each document (scenario), there will be 2 anchorablepane.

I fiddled around with the MVVM example attached,

 

  <avalonDock:DockingManager x:Name="dockManager"
                                   DocumentsSource="{Binding Files}"
                                   AnchorablesSource="{Binding Tools}"
                                   ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
                                   Grid.Row="1">
            <avalonDock:DockingManager.Theme>
                <avalonDock:VS2010Theme/>
            </avalonDock:DockingManager.Theme>
            <avalonDock:DockingManager.LayoutItemTemplateSelector>
                <local:PanesTemplateSelector>
                    <local:PanesTemplateSelector.FileViewTemplate>
                        <DataTemplate>
                           <avalonDock:DockingManager>
                                <avalonDock:LayoutRoot >
                                    <avalonDock:LayoutPanel Orientation="Vertical">
                                        <avalonDock:LayoutAnchorablePane>
                                            <avalonDock:LayoutAnchorable>
                                                <TextBox Text="COOL222"/>
                                            </avalonDock:LayoutAnchorable>
                                            <avalonDock:LayoutAnchorable>
                                                <TextBox Text="COOL"/>
                                            </avalonDock:LayoutAnchorable>
                                        </avalonDock:LayoutAnchorablePane>
                                    </avalonDock:LayoutPanel>
                                </avalonDock:LayoutRoot>
                            </avalonDock:DockingManager>
                        </DataTemplate>
                    </local:PanesTemplateSelector.FileViewTemplate>
                    <local:PanesTemplateSelector.FileStatsViewTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="{Binding FileSize}"/>
                                <TextBlock Text="{Binding LastModified}"/>
                            </StackPanel>
                        </DataTemplate>
                    </local:PanesTemplateSelector.FileStatsViewTemplate>
                </local:PanesTemplateSelector>
            </avalonDock:DockingManager.LayoutItemTemplateSelector>
           
            <avalonDock:DockingManager.LayoutItemContainerStyleSelector>
                <local:PanesStyleSelector>
                    <local:PanesStyleSelector.ToolStyle>
                        <Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
                            <Setter Property="Title" Value="{Binding Model.Title}"/>
                            <Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
                            <Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>
                            <Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
                            <Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
                            <Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
                        </Style>
                    </local:PanesStyleSelector.ToolStyle>
                    <local:PanesStyleSelector.FileStyle>
                        <Style TargetType="{x:Type avalonDock:LayoutItem}">
                            <Setter Property="Title" Value="{Binding Model.Title}"/>
                            <Setter Property="ToolTip" Value="{Binding Model.FilePath}"/>
                            <Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/>
                            <Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
                            <Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
                        </Style>
                    </local:PanesStyleSelector.FileStyle>
                </local:PanesStyleSelector>
            </avalonDock:DockingManager.LayoutItemContainerStyleSelector>
            <avalonDock:DockingManager.LayoutUpdateStrategy>
                <local:LayoutInitializer/>
            </avalonDock:DockingManager.LayoutUpdateStrategy>
           
            <avalonDock:LayoutRoot>
                <avalonDock:LayoutPanel Orientation="Vertical">
                    <avalonDock:LayoutDocumentPane/>
                    <avalonDock:LayoutAnchorablePane Name="ToolsPane" DockWidth="150">
                    </avalonDock:LayoutAnchorablePane>
                </avalonDock:LayoutPanel>
            </avalonDock:LayoutRoot>
        </avalonDock:DockingManager>

 

I would assume for each "New" document i create i would see two tabs for each New File. I use to be able to do this with avalon 1.3 but it just doesn't seem to work now.

Is this do-able in verision2???

 

Thanks and Regards,
Kevin

Jul 18, 2012 at 2:47 PM

Hi, has anyone else have this problem? Please help i really want docking system within each layoutDocument....