我希望对话框内容的背景颜色和按钮后面的背景颜色相同:
我怎样才能做到这一点?
我的xml:
<Page
x:Class="WinUI3BlankAppVS2022.ContentDialogContent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<TextBlock
Text="Lorem ipsum dolor sit amet, adipisicing elit."
TextWrapping="Wrap" />
</StackPanel>
</Page>
我的C#:
private async void ShowDialog_Click(object sender, RoutedEventArgs e)
{
ContentDialog dialog = new ContentDialog();
dialog.Title = "Save your work?";
dialog.PrimaryButtonText = "Save";
dialog.SecondaryButtonText = "Don't Save";
dialog.CloseButtonText = "Cancel";
dialog.DefaultButton = ContentDialogButton.Primary;
dialog.XamlRoot = Content.XamlRoot;
dialog.Content = new ContentDialogContent();
var result = await dialog.ShowAsync();
}