<navigation:Page
d:DesignHeight="768" d:DesignWidth="1366">
<UserControl.Resources>
<sdk:HierarchicalDataTemplate x:Key="Level3">
<StackPanel Orientation="Horizontal">
<ContentPresenter Margin="0 0 4 0" Content="{Binding IconUri}"/>
<HyperlinkButton x:Name="TemplateLinkButton" Content="{Binding MenuCaption}" NavigateUri="{Binding Uri}"/>
</StackPanel>
</sdk:HierarchicalDataTemplate>
<sdk:HierarchicalDataTemplate x:Key="Level2" ItemsSource="{Binding Path=Children}" ItemTemplate="{StaticResource Level3}">
<StackPanel Orientation="Horizontal">
<ContentPresenter Margin="0 0 4 0" Content="{Binding IconUri}"/>
<HyperlinkButton x:Name="TemplateLinkButton" Content="{Binding MenuCaption}" NavigateUri="{Binding Uri}"/>
</StackPanel>
</sdk:HierarchicalDataTemplate>
<sdk:HierarchicalDataTemplate x:Key="Level1" ItemsSource="{Binding Path=Children}" ItemTemplate="{StaticResource Level2}">
<StackPanel Orientation="Horizontal">
<ContentPresenter Margin="0 0 4 0" Content="{Binding IconUri}"/>
<TextBlock Text="{Binding Path=MenuCaption}"/>
</StackPanel>
</sdk:HierarchicalDataTemplate>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" ShowGridLines="True" Background="Blue">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="Header" Name="textBlockHeader"/>
<Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ShowGridLines="True" Background="Pink">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollViewer Height="Auto" Background="CadetBlue">
<sdk:TreeView Name="menuTree" ItemTemplate="{StaticResource Level1}" Background="Fuchsia">
</sdk:TreeView>
</ScrollViewer>
<sdk:Frame HorizontalAlignment="Stretch" Grid.Column="1" VerticalAlignment="Stretch" Source="" Name="contentFrame">
<sdk:Frame.UriMapper>
<sdk:UriMapper>
<sdk:UriMapping MappedUri="/VIEW/{page}.xaml" Uri="/{page}" />
</sdk:UriMapper>
</sdk:Frame.UriMapper>
</sdk:Frame>
</Grid>
</Grid>
</navigation:Page>
这是一个默认的布局标题菜单和内容框架,我希望滚动查看器填充网格 Grid2 的第一列。我尝试了 margin VerticalAlignment
height= "Auto"
,但它还没有工作。