Bilibili-Evolved/extras/vld-windows/VideoLinkDownloader/App.xaml.cs
2019-05-30 20:15:19 +08:00

33 lines
1.0 KiB
C#

using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace VideoLinkDownloader
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var registry = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
// if (registry is null || (int) registry.GetValue("AppsUseLightTheme", 0) == 1)
if (true)
{
Resources.MergedDictionaries.Remove(new ResourceDictionary
{
Source = new Uri("Theme.Dark.xaml", UriKind.Relative),
});
Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new Uri("Theme.Light.xaml", UriKind.Relative),
});
}
}
}
}