0
ベースダイアログのコントロールテンプレートを作成しようとしています。ここにコンテンツの上部に表示できる定義済みのボタンが含まれています。問題は、ボタンがコンテンツと適切に積み重なっていないことです。これは、基本ダイアログリソースのコードがオーバーレイされたボタンをベースコントロールからスタックする方法
です:私はこのような何かを得るために期待しています
:
この
は、私が現在取得しています結果です:<ControlTemplate x:Key="BaseDialogTemplate" TargetType="{x:Type dialogs:BaseDialog}">
<Grid Background="{TemplateBinding Background}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto">
<Grid>
<ContentPresenter x:Name="PART_ContentPresenter"
Content="{TemplateBinding Content}" />
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<StackPanel x:Name="PART_ButtonStackPanel"
Margin="10"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<Button x:Name="PART_OkButton"
MinWidth="80"
Margin="0 0 5 0"
Background="Yellow"
Content="Base Ok Button" />
<Button x:Name="PART_CancelButton"
MinWidth="80"
Margin="5 0 5 0"
Background="Yellow"
Content="Base Cancel Button" />
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</Grid>
</ControlTemplate>
<Style TargetType="{x:Type dialogs:BaseDialog}">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="White" />
<Setter Property="Template" Value="{StaticResource BaseDialogTemplate}" />
</Style>
はご回答いただきありがとうございます。私は前にこのようなことをやろうとしましたが、私が望む結果に満足していませんでした。ボタンはコンテンツの上にあるように表示されません(コンテンツをオーバーレイしません)。 –
実際には、これは私の最善の選択肢であると思います。私はこれを答えにするつもりです。ありがとうございました –