microsoft / fluent-xaml-theme-editor

The Fluent Design XAML theme editor.
MIT License
638 stars 92 forks source link

When color theme is used, ContentDialog covers the whole page #46

Open under3415 opened 4 years ago

under3415 commented 4 years ago

Steps to replicate:

  1. Create new UWP app
  2. Grab a color scheme from Fluent XAML Theme Editor and add it to your project
  3. In App.Xaml add this:
     <Application.Resources>
      <ResourceDictionary>
       <ResourceDictionary.MergedDictionaries>
           <ResourceDictionary Source="Dictionary1.xaml"/>
      </ResourceDictionary.MergedDictionaries>
     </ResourceDictionary>
    </Application.Resources>
  4. Add a TextBlock and Loaded event to MainPage
  5. Add ContentDialog call to Loaded 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();
        }
  6. Run the app and see how ContentDialog covers up the TextBlock. If you remove the color theme this does not happen.
under3415 commented 4 years ago

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" />