Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public async Task SetPresentationFrameworkTheme(Dispatcher dispatcher, Uri resourceUri)
 {
     await dispatcher.InvokeAsync(() => {
         if (resourceUri != null)
         {
             ThemeManager.SetPresentationFrameworkTheme(resourceUri);
         }
         else
         {
             ThemeManager.ClearPresentationFrameworkTheme();
         }
         UxThemeExNativeMethods.UxBroadcastThemeChange();
     }, DispatcherPriority.ContextIdle);
 }