public static async Task SetRequestedThemeAsync()
{
foreach (var view in CoreApplication.Views)
{
await view.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
if (Window.Current.Content is FrameworkElement frameworkElement)
{
frameworkElement.RequestedTheme = Theme;
}
});
}
}
This is my code that correctly changes the theme of views in my app, but now I have some ContentDialogs and they don't change their theme. So in this case I wanna ask two questions:
- I content my popups in static full properties. Is this a good decision or will be better to create a new obj of popup every time?
- If static properties are a good decision, how to change themes in them?
It's looks known issue here. please feel free vote up this report. and currently there is a workaround that set the dialog's theme when show popup like the following.