Skip to content

Commit

Permalink
Optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 15, 2024
1 parent 30ff9d0 commit a986041
Show file tree
Hide file tree
Showing 36 changed files with 46 additions and 54 deletions.
1 change: 1 addition & 0 deletions v2rayN/v2rayN/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private void Init()
Environment.Exit(0);
return;
}
LazyConfig.Instance.SetConfig(_config);

//Under Win10
if (Environment.OSVersion.Version.Major < 10)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Converters/MaterialDesignFonts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static MaterialDesignFonts()
{
try
{
var fontFamily = LazyConfig.Instance.GetConfig().uiItem.currentFontFamily;
var fontFamily = LazyConfig.Instance.Config.uiItem.currentFontFamily;
if (!Utils.IsNullOrEmpty(fontFamily))
{
var fontPath = Utils.GetFontsPath();
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/ClashApiHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void ClashProxiesDelayTest(bool blAll, List<ClashProxyModel> lstProxy, Ac
return;
}
var urlBase = $"{GetApiUrl()}/proxies";
urlBase += @"/{0}/delay?timeout=10000&url=" + LazyConfig.Instance.GetConfig().speedTestItem.speedPingTestUrl;
urlBase += @"/{0}/delay?timeout=10000&url=" + LazyConfig.Instance.Config.speedTestItem.speedPingTestUrl;
List<Task> tasks = new List<Task>();
foreach (var it in lstProxy)
Expand Down
1 change: 0 additions & 1 deletion v2rayN/v2rayN/Handler/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ public static int LoadConfig(ref Config? config)
};
}

LazyConfig.Instance.SetConfig(config);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/CoreConfig/CoreConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static int GenerateClientConfig(ProfileItem node, string? fileName, out s
msg = ResUI.CheckServerSettings;
return -1;
}
var config = LazyConfig.Instance.GetConfig();
var config = LazyConfig.Instance.Config;

msg = ResUI.InitialConfiguration;
if (node.configType == EConfigType.Custom)
Expand Down
12 changes: 6 additions & 6 deletions v2rayN/v2rayN/Handler/DownloadHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task<int> DownloadDataAsync(string url, WebProxy webProxy, int down
{
try
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.guiItem.enableSecurityProtocolTls13);

var progress = new Progress<string>();
progress.ProgressChanged += (sender, value) =>
Expand Down Expand Up @@ -66,7 +66,7 @@ public async Task DownloadFileAsync(string url, bool blProxy, int downloadTimeou
{
try
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.guiItem.enableSecurityProtocolTls13);
UpdateCompleted?.Invoke(this, new ResultEventArgs(false, $"{ResUI.Downloading} {url}"));

var progress = new Progress<double>();
Expand Down Expand Up @@ -96,7 +96,7 @@ await DownloaderHelper.Instance.DownloadFileAsync(webProxy,

public async Task<string?> UrlRedirectAsync(string url, bool blProxy)
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.guiItem.enableSecurityProtocolTls13);
var webRequestHandler = new SocketsHttpHandler
{
AllowAutoRedirect = false,
Expand Down Expand Up @@ -185,7 +185,7 @@ await DownloaderHelper.Instance.DownloadFileAsync(webProxy,
{
try
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.guiItem.enableSecurityProtocolTls13);
var webProxy = GetWebProxy(blProxy);
var client = new HttpClient(new SocketsHttpHandler()
{
Expand Down Expand Up @@ -230,7 +230,7 @@ await DownloaderHelper.Instance.DownloadFileAsync(webProxy,
{
try
{
Utils.SetSecurityProtocol(LazyConfig.Instance.GetConfig().guiItem.enableSecurityProtocolTls13);
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.guiItem.enableSecurityProtocolTls13);

var webProxy = GetWebProxy(blProxy);

Expand Down Expand Up @@ -264,7 +264,7 @@ public async Task<int> RunAvailabilityCheck(IWebProxy? webProxy)

try
{
var config = LazyConfig.Instance.GetConfig();
var config = LazyConfig.Instance.Config;
int responseTime = await GetRealPingTime(config.speedTestItem.speedPingTestUrl, webProxy, 10);
return responseTime;
}
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/HotkeyHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class HotkeyHandler

private Config _config
{
get => LazyConfig.Instance.GetConfig();
get => LazyConfig.Instance.Config;
}

private Dictionary<int, List<EGlobalHotkey>> _hotkeyTriggerDic;
Expand Down
16 changes: 4 additions & 12 deletions v2rayN/v2rayN/Handler/LazyConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public sealed class LazyConfig
{
private static readonly Lazy<LazyConfig> _instance = new(() => new());
private Config _config;

public static LazyConfig Instance => _instance.Value;

private int? _statePort;
private int? _statePort2;

public static LazyConfig Instance => _instance.Value;
public Config Config => _config;

public int StatePort
{
get
Expand Down Expand Up @@ -45,15 +45,7 @@ public LazyConfig()

#region Config

public void SetConfig(Config config)
{
_config = config;
}

public Config GetConfig()
{
return _config;
}
public void SetConfig(Config config) => _config = config;

public int GetLocalPort(EInboundProtocol protocol)
{
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Handler/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ private async Task AskToDownload(DownloadHandler downloadHandle, string url, boo
//}
//if (blDownload)
//{
await downloadHandle.DownloadFileAsync(url, true, 600);
await downloadHandle.DownloadFileAsync(url, true, 600);
//}
}

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/AddServer2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class AddServer2ViewModel : MyReactiveObject
public AddServer2ViewModel(ProfileItem profileItem, Func<EViewAction, object?, bool>? updateView)
{
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_updateView = updateView;

if (profileItem.indexId.IsNullOrEmpty())
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/AddServerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class AddServerViewModel : MyReactiveObject

public AddServerViewModel(ProfileItem profileItem, Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/ClashConnectionsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ClashConnectionsViewModel : MyReactiveObject

public ClashConnectionsViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_updateView = updateView;
SortingSelected = _config.clashUIItem.connectionsSorting;
AutoRefresh = _config.clashUIItem.connectionsAutoRefresh;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/ClashProxiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ClashProxiesViewModel : MyReactiveObject
public ClashProxiesViewModel(Func<EViewAction, object?, bool>? updateView)
{
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_updateView = updateView;

SelectedGroup = new();
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/DNSSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class DNSSettingViewModel : MyReactiveObject

public DNSSettingViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public class MainWindowViewModel : MyReactiveObject

public MainWindowViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
4 changes: 2 additions & 2 deletions v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class OptionSettingViewModel : MyReactiveObject

public OptionSettingViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down Expand Up @@ -301,7 +301,7 @@ private void SaveSetting()
_config.hysteriaItem.up_mbps = hyUpMbps;
_config.hysteriaItem.down_mbps = hyDownMbps;
_config.coreBasicItem.enableFragment = enableFragment;

_config.guiItem.autoRun = AutoRun;
_config.guiItem.enableStatistics = EnableStatistics;
_config.guiItem.keepOlderDedupl = KeepOlderDedupl;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/ProfilesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class ProfilesViewModel : MyReactiveObject

public ProfilesViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/RoutingRuleDetailsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class RoutingRuleDetailsViewModel : MyReactiveObject

public RoutingRuleDetailsViewModel(RulesItem rulesItem, Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/RoutingRuleSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class RoutingRuleSettingViewModel : MyReactiveObject

public RoutingRuleSettingViewModel(RoutingItem routingItem, Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;
SelectedSource = new();
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/RoutingSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class RoutingSettingViewModel : MyReactiveObject

public RoutingSettingViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;
SelectedSource = new();
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/SubEditViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SubEditViewModel : MyReactiveObject

public SubEditViewModel(SubItem subItem, Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/SubSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SubSettingViewModel : MyReactiveObject

public SubSettingViewModel(Func<EViewAction, object?, bool>? updateView)
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
_updateView = updateView;

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/ThemeSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ThemeSettingViewModel : MyReactiveObject

public ThemeSettingViewModel()
{
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
MainFormHandler.Instance.RegisterSystemColorSet(_config, Application.Current.MainWindow, (bool bl) => { ModifyTheme(bl); });

Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/AddServer2Window.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public AddServer2Window(ProfileItem profileItem)
this.BindCommand(ViewModel, vm => vm.EditServerCmd, v => v.btnEdit).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.SaveServerCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/AddServerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public AddServerWindow(ProfileItem profileItem)
});

this.Title = $"{profileItem.configType}";
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
4 changes: 2 additions & 2 deletions v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public DNSSettingWindow()
InitializeComponent();

this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;

ViewModel = new DNSSettingViewModel(UpdateViewHandler);

Expand Down Expand Up @@ -54,7 +54,7 @@ public DNSSettingWindow()
this.BindCommand(ViewModel, vm => vm.ImportDefConfig4V2rayCmd, v => v.btnImportDefConfig4V2ray).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.ImportDefConfig4SingboxCmd, v => v.btnImportDefConfig4Singbox).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public GlobalHotkeySettingWindow()
InitializeComponent();

this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
_config.globalHotkeys ??= new List<KeyEventItem>();

txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public MainWindow()
{
InitializeComponent();

_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;

App.Current.SessionEnding += Current_SessionEnding;
this.Closing += MainWindow_Closing;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/MsgView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class MsgView
public MsgView()
{
InitializeComponent();
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
MessageBus.Current.Listen<string>(Global.CommandSendMsgView).Subscribe(x => DelegateAppendText(x));
Global.PresetMsgFilters.ForEach(it =>
{
Expand Down
4 changes: 2 additions & 2 deletions v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public OptionSettingWindow()
InitializeComponent();

this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;
var lstFonts = GetFonts(Utils.GetFontsPath());

ViewModel = new OptionSettingViewModel(UpdateViewHandler);
Expand Down Expand Up @@ -169,7 +169,7 @@ public OptionSettingWindow()
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/ProfilesView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ProfilesView()
InitializeComponent();
lstGroup.MaxHeight = Math.Floor(SystemParameters.WorkArea.Height * 0.20 / 40) * 40;

_config = LazyConfig.Instance.GetConfig();
_config = LazyConfig.Instance.Config;

Application.Current.Exit += Current_Exit;
btnAutofitColumnWidth.Click += BtnAutofitColumnWidth_Click;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public RoutingRuleDetailsWindow(RulesItem rulesItem)
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public RoutingRuleSettingWindow(RoutingItem routingItem)
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public RoutingSettingWindow()
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.GetConfig().uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.GetConfig().uiItem.colorModeDark);
WindowsUtils.SetDarkBorder(this, LazyConfig.Instance.Config.uiItem.followSystemTheme ? !WindowsUtils.IsLightTheme() : LazyConfig.Instance.Config.uiItem.colorModeDark);
}

private bool UpdateViewHandler(EViewAction action, object? obj)
Expand Down
Loading

0 comments on commit a986041

Please sign in to comment.