2013-04-12 2 views
5

저는 C# 및 WinForms 경험이 많지만 WPF의 초보자입니다. 아래쪽으로 확장되는 확장기가있는 창이 있습니다. 현재 입력중인 질문 상자와 비슷하게 사용자가 아래쪽에있는 글리프 (이 질문 상자와 같은)를 클릭하고 원하는 크기로 확장자를 끌어 확장기의 크기를 동적으로 조정할 수 있기를 바랍니다.사용자가 WPF로 확대기를 확대 할 수 있습니다.

누구나 XAML (및 추가 코드)을 제공 할 수 있습니까?

<Expander Header="Live Simulations" Name="expandLiveSims" Grid.Row="0" ExpandDirection="Down" IsExpanded="True"> 
    <Expander.Background> 
     <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> 
      <GradientStop Color="White" Offset="0" /> 
      <GradientStop Color="LightGray" Offset="0.767" /> 
      <GradientStop Color="Gainsboro" Offset="1" /> 
     </LinearGradientBrush> 
    </Expander.Background> 
    <Grid> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="*" /> 
      <RowDefinition Height="Auto" /> 
     </Grid.RowDefinitions> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition Width="*" /> 
      <ColumnDefinition Width="Auto" /> 
      <ColumnDefinition Width="Auto" /> 
     </Grid.ColumnDefinitions> 
     <DataGrid Height="250" Margin="5" Name="gridLiveProducts" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0"> 
     </DataGrid> 
     <GridSplitter Grid.Row="0" Grid.Column="1" Width="3" VerticalAlignment="Stretch" HorizontalAlignment="Center"> 
      <GridSplitter.Background> 
       <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> 
        <GradientStop Color="White" Offset="0" /> 
        <GradientStop Color="DarkGray" Offset="0.25" /> 
        <GradientStop Color="DarkGray" Offset="0.75" /> 
        <GradientStop Color="Gainsboro" Offset="1" /> <!-- Gainsboro matches the expander --> 
       </LinearGradientBrush> 
      </GridSplitter.Background> 
     </GridSplitter> 
     <Border Grid.Row="0" Grid.Column="2" Background="White" BorderBrush="Black" BorderThickness="1" Margin="5" > 
      <Image Height="250" HorizontalAlignment="Right" Name="imgShares" Stretch="Fill" VerticalAlignment="Top" Width="250"> 
      </Image> 
     </Border> 
     <GridSplitter Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Height="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="3"> 
      <GridSplitter.Background> 
       <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> 
        <GradientStop Color="Gainsboro" Offset="0" /> 
        <GradientStop Color="DarkGray" Offset="0.25" /> 
        <GradientStop Color="DarkGray" Offset="0.75" /> 
        <GradientStop Color="Gainsboro" Offset="1" /> 
       </LinearGradientBrush> 
      </GridSplitter.Background> 
     </GridSplitter> 
    </Grid> 
</Expander> 
+0

당신은 솔루션을 받으셨어요? – OsakaHQ

+0

실제 솔루션을 찾을 수 없습니다. 우리는 UI를 리팩토링했으며 더 이상 필요하지 않았습니다. –

답변

6

당신은 GridSplitterGrid을 사용할 수 있습니다

이것은 내가 지금까지있는 것입니다. 이처럼

:

이 방법으로 성공을 위해
<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="auto"/> 
     <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 
    <Expander Grid.Row="0" Background="Azure"></Expander> <!--this is you Expander--> 
    <GridSplitter Grid.Row="1" Height="10" Background="Red" ResizeDirection="Rows" HorizontalAlignment="Stretch"/> <!--this GridSplitter represents the glyph--> 
</Grid> 

가, 견인 조롱 측면이 있어야합니다 높이 = "*"

+2

나는 그것을 시도하고 확장기의 크기를 조정할 수 있지만 확장기가 더 이상 확장/축소 아이콘에 응답하지 않습니다. 확장기가 정상적으로 축소되지만 확장 된 크기를 사용자가 제어 할 수있게하고 싶습니다. –

관련 문제