fluent-xaml-theme-editor
fluent-xaml-theme-editor copied to clipboard
When color theme is used, ContentDialog covers the whole page
Steps to replicate:
- Create new UWP app
- Grab a color scheme from Fluent XAML Theme Editor and add it to your project
- In
App.Xaml
add this:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
- Add a
TextBlock
andLoaded
event toMainPage
- Add
ContentDialog
call toLoaded
event
private async void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
ContentDialog noWifiDialog = new ContentDialog
{
Title = "No wifi connection",
Content = "Check your connection and try again.",
CloseButtonText = "Ok"
};
_ = await noWifiDialog.ShowAsync();
}
- Run the app and see how
ContentDialog
covers up theTextBlock
. If you remove the color theme this does not happen.
You need to add this to your theme to fix the ContentDialog issue
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
<StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />