'UWP set background from dark/light dictionary

 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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source