0

I have downloaded the avalon 2.0 and on load the tool panel starts on the right and the files panel starts on the left.

I am trying to get the tool panel to dock on the left on load even when I have deleted everything that is related to FileViewModel which loads on the left a blank panel stays on the left.

This image below shows how the window currently loads: Rightpanel

I want to have the tool panel loads on the left like this:(I achieved this by dragging the tool pane on run time.Would like to load the app like this.

In my WPF I can only see one LayoutAnchorablePane so I can't see why the screen is split into two?

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="3"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Menu Grid.Row="0">
        <MenuItem Header="File">
            <MenuItem Header="New" Command="{Binding NewCommand}"/>
            <MenuItem Header="Open" Command="{Binding OpenCommand}"/>
            <Separator/>
            <MenuItem Header="Save" Command="{Binding ActiveDocument.SaveCommand}"/>
            <MenuItem Header="Save As..." Command="{Binding ActiveDocument.SaveAsCommand}"/>
            <Separator/>
            <MenuItem Header="Close" Command="{Binding ActiveDocument.CloseCommand}"/>
        </MenuItem>
        <MenuItem Header="Tools">
            <MenuItem Header="{Binding FileStats.Title, Mode=TwoWay}" IsChecked="{Binding FileStats.IsVisible, Mode=TwoWay}" IsCheckable="True"/>
            <MenuItem Header="{Binding Exported.Title, Mode=TwoWay}" IsChecked="{Binding Exported.IsVisible, Mode=TwoWay}" IsCheckable="True"/>
            <MenuItem Header="{Binding ExportedResult.Title, Mode=TwoWay}" IsChecked="{Binding ExportedResult.IsVisible, Mode=TwoWay}" IsCheckable="True"/>
            <MenuItem Header="{Binding Manifest.Title, Mode=TwoWay}" IsChecked="{Binding Manifest.IsVisible, Mode=TwoWay}" IsCheckable="True"/>
        </MenuItem>
        <MenuItem Header="Layout">
            <MenuItem Header="Load" Command="{Binding LoadLayoutCommand, ElementName=mainWindow}"/>
            <MenuItem Header="Save" Command="{Binding SaveLayoutCommand, ElementName=mainWindow}"/>
            <MenuItem Header="Dump to Console" Click="OnDumpToConsole"/>

        </MenuItem>
    </Menu><!--AnchorablesSource="{Binding Tools}" DocumentsSource="{Binding Files}"-->
    <avalonDock:DockingManager x:Name="dockManager" 
                               AnchorablesSource="{Binding Tools}" 
                               DocumentsSource="{Binding Files}"
                               ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
                               Grid.Row="1" >
        <avalonDock:DockingManager.LayoutItemTemplateSelector>
            <local:PanesTemplateSelector>
                <local:PanesTemplateSelector.FileStatsViewTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="{Binding FileSize}"/>
                            <TextBlock Text="{Binding LastModified}"/>
                            <TextBox Text="test"/>
                        </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>
        </avalonDock:DockingManager.LayoutItemContainerStyleSelector>
        <avalonDock:DockingManager.LayoutUpdateStrategy>
            <local:LayoutInitializer/>
        </avalonDock:DockingManager.LayoutUpdateStrategy>
        <avalonDock:LayoutRoot>
            <avalonDock:LayoutPanel Orientation="Horizontal" >
                <avalonDock:LayoutAnchorablePane Name="ToolsPane" DockHeight="150" >
                </avalonDock:LayoutAnchorablePane>
                <avalonDock:LayoutDocumentPane />
            </avalonDock:LayoutPanel>
        </avalonDock:LayoutRoot>
    </avalonDock:DockingManager>
</Grid>
Dev
  • 1,780
  • 3
  • 18
  • 46
  • After posting this question I realise that There was an element "LayoutDocumentPane" within my AvalonDock.config which keeps getting Deserialized on load. – Dev May 30 '17 at 14:06

1 Answers1

-1

this seems to work, but take care that the sample is saving the state

 <avalonDock:LayoutRoot>
            <avalonDock:LayoutPanel Orientation="Horizontal">
                <avalonDock:LayoutAnchorablePane Name="ToolsPane" DockWidth="100">
                    <avalonDock:LayoutAnchorable>
                        <TextBlock>tototo</TextBlock>
                    </avalonDock:LayoutAnchorable>
                </avalonDock:LayoutAnchorablePane>

                <avalonDock:LayoutDocumentPane/>

            </avalonDock:LayoutPanel>
        </avalonDock:LayoutRoot>
    </avalonDock:DockingManager>
GCamel
  • 612
  • 4
  • 8