2017-05-30 9 views
0

私はavalon 2.0をダウンロードしました。ツールパネルがロードされると、右側にツールパネルが開き、左側にファイルパネルが表示されます。Avalon 2.0スタートアップのレイアウトを変更する方法WPF

左に空白のパネルが左側に残っているFileViewModelに関連するものをすべて削除した場合でも、ロード時にツールパネルを左にドッキングしようとしています。私はこのような左側のツールパネルの負荷を持つようにしたい Rightpanel

を::

下のこの画像は、ウィンドウが現在ロード方法を示して(私は、実行時にツールウィンドウをドラッグすることによって、これを達成Would like to load the app like this.

。私のWPFでは

私はこれだけが動作しているようです

<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> 
+0

この質問を投稿した後、私のAvalonDock.config内に要素「LayoutDocumentPane」があり、ロード時にデシリアライズされています。 – Decoder94

答えて

-1

?画面が二つに分割され、なぜ私が見ることができない1 LayoutAnchorablePaneを参照してください、しかし、サンプルは状態を保存している世話をすることができます

<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> 
関連する問題