mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-01 02:52:09 +03:00
Refactor UI platform visibility to use ViewModel properties
This commit is contained in:
@@ -62,6 +62,8 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
[Reactive]
|
||||
public int TabMainSelectedIndex { get; set; }
|
||||
|
||||
[Reactive] public bool BlIsWindows { get; set; }
|
||||
|
||||
#endregion Menu
|
||||
|
||||
#region Init
|
||||
@@ -70,6 +72,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
{
|
||||
_config = AppManager.Instance.Config;
|
||||
_updateView = updateView;
|
||||
BlIsWindows = Utils.IsWindows();
|
||||
|
||||
#region WhenAnyValue && ReactiveCommand
|
||||
|
||||
|
||||
@@ -69,6 +69,15 @@ public class OptionSettingViewModel : MyReactiveObject
|
||||
|
||||
#endregion UI
|
||||
|
||||
#region UI visibility
|
||||
|
||||
[Reactive] public bool BlIsWindows { get; set; }
|
||||
[Reactive] public bool BlIsLinux { get; set; }
|
||||
[Reactive] public bool BlIsIsMacOS { get; set; }
|
||||
[Reactive] public bool BlIsNonWindows { get; set; }
|
||||
|
||||
#endregion UI visibility
|
||||
|
||||
#region System proxy
|
||||
|
||||
[Reactive] public bool notProxyLocalAddress { get; set; }
|
||||
@@ -108,6 +117,10 @@ public class OptionSettingViewModel : MyReactiveObject
|
||||
{
|
||||
_config = AppManager.Instance.Config;
|
||||
_updateView = updateView;
|
||||
BlIsWindows = Utils.IsWindows();
|
||||
BlIsLinux = Utils.IsLinux();
|
||||
BlIsIsMacOS = Utils.IsMacOS();
|
||||
BlIsNonWindows = Utils.IsNonWindows();
|
||||
|
||||
SaveCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user