var solcolor = (SolidColorBrush)Application.Current.Resources["PopUpsBackground"];
this.Background = new SolidColorBrush(solcolor.Color);
I set the Background of ContentDialogs programmatically but it gets the requested theme color from an application, but I need to get the color that I set. I find this:
dialog.RequestedTheme = (Window.Current.Content as FrameworkElement).RequestedTheme;
But now I need to get color from the dictionary I need( dark or light) I also find this:
Background="{Binding Source={ThemeResource PopUpsBackground}}"
but it does not work either
You need set
ThemeDictionaries
in theApplication.Resources
like following. And custom ContentDialog's style edit the default Background property as your custom value. For more detail please refer to this document.Please note, for making ContentDialog new style effect, you need restart your app after change current theme.