「WPF レイアウト サンプル」の版間の差分
ナビゲーションに移動
検索に移動
(同じ利用者による、間の1版が非表示) | |||
1行目: | 1行目: | ||
− | ==WPF レイアウト サンプル== | + | ==[[WPF レイアウト サンプル]]== |
− | [[WPF][WPF レイアウト]] | + | [[WPF]] | [[WPF レイアウト]] | |
===Explorer風=== | ===Explorer風=== | ||
7行目: | 7行目: | ||
*ShowGridLines="True" でグリッドレイアウトの分割を可視化 | *ShowGridLines="True" でグリッドレイアウトの分割を可視化 | ||
<DockPanel> | <DockPanel> | ||
− | <Button Content="Menu" DockPanel.Dock="Top"/> | + | <Button Content="[[Menu]]" DockPanel.Dock="Top"/> |
<Button Content="Status" DockPanel.Dock="Bottom"/> | <Button Content="Status" DockPanel.Dock="Bottom"/> | ||
<Grid ShowGridLines="True"> | <Grid ShowGridLines="True"> | ||
15行目: | 15行目: | ||
<ColumnDefinition MinWidth="100" Width="2*"/> | <ColumnDefinition MinWidth="100" Width="2*"/> | ||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <Button Grid.Column="0" Grid. | + | <Button Grid.Column="0" Grid.[[R]]ow="0" Content="Left Top"/> |
− | <GridSplitter Grid.Column="0" Grid. | + | <GridSplitter Grid.Column="0" Grid.[[R]]ow="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> |
− | <Button Grid.Column="0" Grid. | + | <Button Grid.Column="0" Grid.[[R]]ow="2" Content="Left Bottom"/> |
− | <GridSplitter Grid.Column="1" Width="5" Grid. | + | <GridSplitter Grid.Column="1" Width="5" Grid.[[R]]owSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> |
− | <Button Grid.Column="2" Grid. | + | <Button Grid.Column="2" Grid.[[R]]ow="0" Grid.[[R]]owSpan="3" Content="Content"/> |
</Grid> | </Grid> | ||
</DockPanel> | </DockPanel> | ||
31行目: | 31行目: | ||
*TreeView を配置し、スプリットバー移動や、ツリーの展開で動的にスクロールバーが表示されるようにする | *TreeView を配置し、スプリットバー移動や、ツリーの展開で動的にスクロールバーが表示されるようにする | ||
<DockPanel> | <DockPanel> | ||
− | <Button Content="Menu" DockPanel.Dock="Top"/> | + | <Button Content="[[Menu]]" DockPanel.Dock="Top"/> |
<Button Content="Status" DockPanel.Dock="Bottom"/> | <Button Content="Status" DockPanel.Dock="Bottom"/> | ||
<Grid ShowGridLines="True"> | <Grid ShowGridLines="True"> | ||
39行目: | 39行目: | ||
<ColumnDefinition MinWidth="100" Width="2*"/> | <ColumnDefinition MinWidth="100" Width="2*"/> | ||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
<TreeView Grid.Column="0" ItemsSource="{Binding TreeItems}"> | <TreeView Grid.Column="0" ItemsSource="{Binding TreeItems}"> | ||
<TreeView.ItemTemplate> | <TreeView.ItemTemplate> | ||
51行目: | 51行目: | ||
</TreeView.ItemTemplate> | </TreeView.ItemTemplate> | ||
</TreeView> | </TreeView> | ||
− | <GridSplitter Grid.Column="0" Grid. | + | <GridSplitter Grid.Column="0" Grid.[[R]]ow="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> |
− | <Button Grid.Column="0" Grid. | + | <Button Grid.Column="0" Grid.[[R]]ow="2" Content="Left Bottom"/> |
− | <GridSplitter Grid.Column="1" Width="5" Grid. | + | <GridSplitter Grid.Column="1" Width="5" Grid.[[R]]owSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> |
− | <Button Grid.Column="2" Grid. | + | <Button Grid.Column="2" Grid.[[R]]ow="0" Grid.[[R]]owSpan="3" Content="{Binding Name}"/> |
</Grid> | </Grid> | ||
</DockPanel> | </DockPanel> | ||
63行目: | 63行目: | ||
*コンテンツとしてテキストを可変サイズにする | *コンテンツとしてテキストを可変サイズにする | ||
<DockPanel> | <DockPanel> | ||
− | <Button Content="Menu" DockPanel.Dock="Top"/> | + | <Button Content="[[Menu]]" DockPanel.Dock="Top"/> |
<Button Content="Status" DockPanel.Dock="Bottom"/> | <Button Content="Status" DockPanel.Dock="Bottom"/> | ||
<Grid ShowGridLines="False"> | <Grid ShowGridLines="False"> | ||
71行目: | 71行目: | ||
<ColumnDefinition MinWidth="100" Width="2*"/> | <ColumnDefinition MinWidth="100" Width="2*"/> | ||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <Grid Grid.Column="0" Grid. | + | <Grid Grid.Column="0" Grid.[[R]]ow="0" ShowGridLines="False"> |
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition Height="*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <DockPanel Grid. | + | <DockPanel Grid.[[R]]ow="0"> |
<TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | ||
− | <Button Content="Control" Width="Auto" DockPanel.Dock=" | + | <Button Content="Control" Width="Auto" DockPanel.Dock="[[R]]ight"/> |
<TextBox /> | <TextBox /> | ||
</DockPanel> | </DockPanel> | ||
− | <TreeView Grid. | + | <TreeView Grid.[[R]]ow="1" ItemsSource="{Binding TreeItems}"> |
<TreeView.ItemTemplate> | <TreeView.ItemTemplate> | ||
<HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | ||
94行目: | 94行目: | ||
</TreeView> | </TreeView> | ||
</Grid> | </Grid> | ||
− | <GridSplitter Grid.Column="0" Grid. | + | <GridSplitter Grid.Column="0" Grid.[[R]]ow="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> |
− | <Grid Grid.Column="0" Grid. | + | <Grid Grid.Column="0" Grid.[[R]]ow="2" ShowGridLines="False"> |
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition Height="*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <DockPanel Grid. | + | <DockPanel Grid.[[R]]ow="0"> |
<TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | ||
− | <Button Content="Control" Width="Auto" DockPanel.Dock=" | + | <Button Content="Control" Width="Auto" DockPanel.Dock="[[R]]ight"/> |
<TextBox /> | <TextBox /> | ||
</DockPanel> | </DockPanel> | ||
− | <TreeView Grid. | + | <TreeView Grid.[[R]]ow="1" ItemsSource="{Binding TreeItems}"> |
<TreeView.ItemTemplate> | <TreeView.ItemTemplate> | ||
<HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | ||
113行目: | 113行目: | ||
</TreeView> | </TreeView> | ||
</Grid> | </Grid> | ||
− | <GridSplitter Grid.Column="1" Width="5" Grid. | + | <GridSplitter Grid.Column="1" Width="5" Grid.[[R]]owSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> |
− | <Button Grid.Column="2" Grid. | + | <Button Grid.Column="2" Grid.[[R]]ow="0" Grid.[[R]]owSpan="3" Content="{Binding Name}"/> |
</Grid> | </Grid> | ||
</DockPanel> | </DockPanel> | ||
121行目: | 121行目: | ||
[[File:1455_wpf_layout04.jpg]] | [[File:1455_wpf_layout04.jpg]] | ||
<DockPanel> | <DockPanel> | ||
− | <Menu DockPanel.Dock="Top" Height="Auto"> | + | <[[Menu]] DockPanel.Dock="Top" Height="Auto"> |
− | <MenuItem Header="ファイル(_F)" /> | + | <MenuItem [[Header]]="ファイル(_F)" /> |
− | <MenuItem Header="編集(_E)" /> | + | <MenuItem [[Header]]="編集(_E)" /> |
− | <MenuItem Header="オプション(_O)"> | + | <MenuItem [[Header]]="オプション(_O)"> |
− | <MenuItem IsCheckable="True" Header="オプション1" /> | + | <MenuItem IsCheckable="True" [[Header]]="オプション1" /> |
− | <MenuItem IsCheckable="True" Header="オプション2" /> | + | <MenuItem IsCheckable="True" [[Header]]="オプション2" /> |
− | <MenuItem IsCheckable="True" Header="オプション3" /> | + | <MenuItem IsCheckable="True" [[Header]]="オプション3" /> |
− | </ | + | </[[Menu]]Item> |
− | </Menu> | + | </[[Menu]]> |
<StatusBar DockPanel.Dock="Bottom"> | <StatusBar DockPanel.Dock="Bottom"> | ||
− | <StatusBarItem Width="60" DockPanel.Dock=" | + | <StatusBarItem Width="60" DockPanel.Dock="[[R]]ight">Panel2</StatusBarItem> |
− | <Separator DockPanel.Dock=" | + | <Separator DockPanel.Dock="[[R]]ight" /> |
− | <StatusBarItem Width="60" DockPanel.Dock=" | + | <StatusBarItem Width="60" DockPanel.Dock="[[R]]ight">Panel3</StatusBarItem> |
− | <Separator DockPanel.Dock=" | + | <Separator DockPanel.Dock="[[R]]ight" /> |
<StatusBarItem>Panel1</StatusBarItem> | <StatusBarItem>Panel1</StatusBarItem> | ||
</StatusBar> | </StatusBar> | ||
143行目: | 143行目: | ||
<ColumnDefinition MinWidth="100" Width="2*"/> | <ColumnDefinition MinWidth="100" Width="2*"/> | ||
</Grid.ColumnDefinitions> | </Grid.ColumnDefinitions> | ||
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition MinHeight="100" Height="1*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <Grid Grid.Column="0" Grid. | + | <Grid Grid.Column="0" Grid.[[R]]ow="0" ShowGridLines="False"> |
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition Height="*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <DockPanel Grid. | + | <DockPanel Grid.[[R]]ow="0"> |
<TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | ||
− | <Button Content="Control" Width="Auto" DockPanel.Dock=" | + | <Button Content="Control" Width="Auto" DockPanel.Dock="[[R]]ight"/> |
<TextBox /> | <TextBox /> | ||
</DockPanel> | </DockPanel> | ||
− | <TreeView Grid. | + | <TreeView Grid.[[R]]ow="1" ItemsSource="{Binding TreeItems}"> |
<TreeView.ItemTemplate> | <TreeView.ItemTemplate> | ||
<HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | ||
166行目: | 166行目: | ||
</TreeView> | </TreeView> | ||
</Grid> | </Grid> | ||
− | <GridSplitter Grid.Column="0" Grid. | + | <GridSplitter Grid.Column="0" Grid.[[R]]ow="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> |
− | <Grid Grid.Column="0" Grid. | + | <Grid Grid.Column="0" Grid.[[R]]ow="2" ShowGridLines="False"> |
− | <Grid. | + | <Grid.[[R]]owDefinitions> |
− | < | + | <[[R]]owDefinition Height="Auto"/> |
− | < | + | <[[R]]owDefinition Height="*"/> |
− | </Grid. | + | </Grid.[[R]]owDefinitions> |
− | <DockPanel Grid. | + | <DockPanel Grid.[[R]]ow="0"> |
<TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> | ||
− | <Button Content="Control" Width="Auto" DockPanel.Dock=" | + | <Button Content="Control" Width="Auto" DockPanel.Dock="[[R]]ight"/> |
<TextBox /> | <TextBox /> | ||
</DockPanel> | </DockPanel> | ||
− | <TreeView Grid. | + | <TreeView Grid.[[R]]ow="1" ItemsSource="{Binding TreeItems}"> |
<TreeView.ItemTemplate> | <TreeView.ItemTemplate> | ||
<HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> | ||
185行目: | 185行目: | ||
</TreeView> | </TreeView> | ||
</Grid> | </Grid> | ||
− | <GridSplitter Grid.Column="1" Width="5" Grid. | + | <GridSplitter Grid.Column="1" Width="5" Grid.[[R]]owSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> |
− | <Button Grid.Column="2" Grid. | + | <Button Grid.Column="2" Grid.[[R]]ow="0" Grid.[[R]]owSpan="3" Content="{Binding Name}"/> |
</Grid> | </Grid> | ||
</DockPanel> | </DockPanel> |
2020年2月16日 (日) 04:34時点における最新版
WPF レイアウト サンプル
Explorer風
- GridSplitterでサイズ変更可(行、列)
- ShowGridLines="True" でグリッドレイアウトの分割を可視化
<DockPanel> <Button Content="Menu" DockPanel.Dock="Top"/> <Button Content="Status" DockPanel.Dock="Bottom"/> <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="1*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition MinWidth="100" Width="2*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition MinHeight="100" Height="1*"/> <RowDefinition Height="Auto"/> <RowDefinition MinHeight="100" Height="1*"/> </Grid.RowDefinitions> <Button Grid.Column="0" Grid.Row="0" Content="Left Top"/> <GridSplitter Grid.Column="0" Grid.Row="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> <Button Grid.Column="0" Grid.Row="2" Content="Left Bottom"/> <GridSplitter Grid.Column="1" Width="5" Grid.RowSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> <Button Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" Content="Content"/> </Grid> </DockPanel>
ツリービューを配置
- TreeView を配置し、スプリットバー移動や、ツリーの展開で動的にスクロールバーが表示されるようにする
<DockPanel> <Button Content="Menu" DockPanel.Dock="Top"/> <Button Content="Status" DockPanel.Dock="Bottom"/> <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="1*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition MinWidth="100" Width="2*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition MinHeight="100" Height="1*"/> <RowDefinition Height="Auto"/> <RowDefinition MinHeight="100" Height="1*"/> </Grid.RowDefinitions> <TreeView Grid.Column="0" ItemsSource="{Binding TreeItems}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> <GridSplitter Grid.Column="0" Grid.Row="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> <Button Grid.Column="0" Grid.Row="2" Content="Left Bottom"/> <GridSplitter Grid.Column="1" Width="5" Grid.RowSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> <Button Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" Content="{Binding Name}"/> </Grid> </DockPanel>
ツリービューに対するコントロールボックスを追加
- DocPanel により、ラベルとボタンをそれぞれ、左、右寄せ
- コンテンツとしてテキストを可変サイズにする
<DockPanel> <Button Content="Menu" DockPanel.Dock="Top"/> <Button Content="Status" DockPanel.Dock="Bottom"/> <Grid ShowGridLines="False"> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="1*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition MinWidth="100" Width="2*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition MinHeight="100" Height="1*"/> <RowDefinition Height="Auto"/> <RowDefinition MinHeight="100" Height="1*"/> </Grid.RowDefinitions> <Grid Grid.Column="0" Grid.Row="0" ShowGridLines="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0"> <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> <Button Content="Control" Width="Auto" DockPanel.Dock="Right"/> <TextBox /> </DockPanel> <TreeView Grid.Row="1" ItemsSource="{Binding TreeItems}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </Grid> <GridSplitter Grid.Column="0" Grid.Row="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> <Grid Grid.Column="0" Grid.Row="2" ShowGridLines="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0"> <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> <Button Content="Control" Width="Auto" DockPanel.Dock="Right"/> <TextBox /> </DockPanel> <TreeView Grid.Row="1" ItemsSource="{Binding TreeItems}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </Grid> <GridSplitter Grid.Column="1" Width="5" Grid.RowSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> <Button Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" Content="{Binding Name}"/> </Grid> </DockPanel>
メニューとステータスバー追加
<DockPanel> <Menu DockPanel.Dock="Top" Height="Auto"> <MenuItem Header="ファイル(_F)" /> <MenuItem Header="編集(_E)" /> <MenuItem Header="オプション(_O)"> <MenuItem IsCheckable="True" Header="オプション1" /> <MenuItem IsCheckable="True" Header="オプション2" /> <MenuItem IsCheckable="True" Header="オプション3" /> </MenuItem> </Menu> <StatusBar DockPanel.Dock="Bottom"> <StatusBarItem Width="60" DockPanel.Dock="Right">Panel2</StatusBarItem> <Separator DockPanel.Dock="Right" /> <StatusBarItem Width="60" DockPanel.Dock="Right">Panel3</StatusBarItem> <Separator DockPanel.Dock="Right" /> <StatusBarItem>Panel1</StatusBarItem> </StatusBar> <Grid ShowGridLines="False"> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="1*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition MinWidth="100" Width="2*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition MinHeight="100" Height="1*"/> <RowDefinition Height="Auto"/> <RowDefinition MinHeight="100" Height="1*"/> </Grid.RowDefinitions> <Grid Grid.Column="0" Grid.Row="0" ShowGridLines="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0"> <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> <Button Content="Control" Width="Auto" DockPanel.Dock="Right"/> <TextBox /> </DockPanel> <TreeView Grid.Row="1" ItemsSource="{Binding TreeItems}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </Grid> <GridSplitter Grid.Column="0" Grid.Row="1" Height="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" /> <Grid Grid.Column="0" Grid.Row="2" ShowGridLines="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0"> <TextBlock Text="Search" Width="Auto" DockPanel.Dock="Left"/> <Button Content="Control" Width="Auto" DockPanel.Dock="Right"/> <TextBox /> </DockPanel> <TreeView Grid.Row="1" ItemsSource="{Binding TreeItems}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:TreeEntity}" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Name}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </Grid> <GridSplitter Grid.Column="1" Width="5" Grid.RowSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"/> <Button Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" Content="{Binding Name}"/> </Grid> </DockPanel>
© 2006 矢木浩人