私はC#とWinFormsの経験は豊富ですが、WPFの初心者です。私は下に広がるExpanderを持つWindowを持っています。私が現在入力している質問ボックスのように、ユーザは、(この質問ボックスのような)グリフをクリックし、エキスパンダーを目的のサイズにドラッグすることで、エキスパンダーのサイズを動的に変更できるようにしたいと思います。ユーザーが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>
あなたは解決されましたか。 – OsakaHQ
実際の解決策は見つかりませんでした。私たちはUIをリファクタリングしましたが、これはもはや必要ありませんでした。 –