public async Task SetThemeAsync(string path, UxThemeLoadParams loadParams = null) { if (path != null) { SetNativeTheme(await Task.Run(() => LoadTheme(path, loadParams))); } else { SetNativeTheme(SafeThemeFileHandle.Zero); } CurrentOverride = path; UxThemeExNativeMethods.UxBroadcastThemeChange(); }
public async Task SetPresentationFrameworkTheme(Dispatcher dispatcher, Uri resourceUri) { await dispatcher.InvokeAsync(() => { if (resourceUri != null) { ThemeManager.SetPresentationFrameworkTheme(resourceUri); } else { ThemeManager.ClearPresentationFrameworkTheme(); } UxThemeExNativeMethods.UxBroadcastThemeChange(); }, DispatcherPriority.ContextIdle); }