2017-07-01 76 views

回答

2

使用來自UWPCommunityToolkit的控制GridSplitter

這是一個示例代碼。來源:GridSplitter

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <Grid.RowDefinitions> 
     <RowDefinition MinHeight="100"></RowDefinition> 
     <RowDefinition Height="11"></RowDefinition> 
     <RowDefinition></RowDefinition> 
    </Grid.RowDefinitions> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition MinWidth="200"></ColumnDefinition> 
     <ColumnDefinition Width="11"></ColumnDefinition> 
     <ColumnDefinition></ColumnDefinition> 
    </Grid.ColumnDefinitions> 

    <!--Column Grid Splitter--> 
    <controls:GridSplitter Grid.Column="1" Width="11" ResizeBehavior="BasedOnAlignment" ResizeDirection="Auto" Background="Gray" Foreground="White" FontSize="13"> 
     <controls:GridSplitter.Element> 
      <Grid> 
       <TextBlock HorizontalAlignment="Center" IsHitTestVisible="False" VerticalAlignment="Center" Text="&#xE784;" Foreground="Black" FontFamily="Segoe MDL2 Assets"> 
       </TextBlock> 
      </Grid> 
     </controls:GridSplitter.Element> 
    </controls:GridSplitter> 

    <!--Row Grid Splitter--> 
    <controls:GridSplitter Foreground="White" Grid.Row="1" ResizeBehavior="BasedOnAlignment" ResizeDirection="Auto" Background="Gray" Height="11" HorizontalAlignment="Stretch" FontSize="13"> 
     <controls:GridSplitter.Element> 
      <Grid> 
       <TextBlock HorizontalAlignment="Center" IsHitTestVisible="False" VerticalAlignment="Center" Text="&#xE76F;" Foreground="Black" FontFamily="Segoe MDL2 Assets"> 
       </TextBlock> 
      </Grid> 
     </controls:GridSplitter.Element> 
    </controls:GridSplitter> 
</Grid> 
相關問題