|
|
@ -7,6 +7,7 @@ using Avalonia.Interactivity; |
|
|
|
using Avalonia.ReactiveUI; |
|
|
|
using Avalonia.ReactiveUI; |
|
|
|
using Avalonia.Threading; |
|
|
|
using Avalonia.Threading; |
|
|
|
using DialogHostAvalonia; |
|
|
|
using DialogHostAvalonia; |
|
|
|
|
|
|
|
using MsBox.Avalonia.Enums; |
|
|
|
using ReactiveUI; |
|
|
|
using ReactiveUI; |
|
|
|
using Splat; |
|
|
|
using Splat; |
|
|
|
using System.ComponentModel; |
|
|
|
using System.ComponentModel; |
|
|
@ -33,7 +34,6 @@ namespace v2rayN.Desktop.Views |
|
|
|
this.KeyDown += MainWindow_KeyDown; |
|
|
|
this.KeyDown += MainWindow_KeyDown; |
|
|
|
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click; |
|
|
|
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click; |
|
|
|
menuPromotion.Click += menuPromotion_Click; |
|
|
|
menuPromotion.Click += menuPromotion_Click; |
|
|
|
menuClose.Click += menuClose_Click; |
|
|
|
|
|
|
|
menuCheckUpdate.Click += MenuCheckUpdate_Click; |
|
|
|
menuCheckUpdate.Click += MenuCheckUpdate_Click; |
|
|
|
menuBackupAndRestore.Click += MenuBackupAndRestore_Click; |
|
|
|
menuBackupAndRestore.Click += MenuBackupAndRestore_Click; |
|
|
|
|
|
|
|
|
|
|
@ -80,6 +80,7 @@ namespace v2rayN.Desktop.Views |
|
|
|
|
|
|
|
|
|
|
|
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); |
|
|
|
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); |
|
|
|
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); |
|
|
|
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); |
|
|
|
|
|
|
|
this.BindCommand(ViewModel, vm => vm.ExitCmd, v => v.menuClose).DisposeWith(disposables); |
|
|
|
|
|
|
|
|
|
|
|
switch (_config.UiItem.MainGirdOrientation) |
|
|
|
switch (_config.UiItem.MainGirdOrientation) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -242,6 +243,14 @@ namespace v2rayN.Desktop.Views |
|
|
|
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(), |
|
|
|
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(), |
|
|
|
DispatcherPriority.Default); |
|
|
|
DispatcherPriority.Default); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case EViewAction.ShowYesNo: |
|
|
|
|
|
|
|
if (await UI.ShowYesNo(this, ResUI.menuExitTips) == ButtonResult.No) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
StorageUI(); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return await Task.FromResult(true); |
|
|
|
return await Task.FromResult(true); |
|
|
@ -304,12 +313,6 @@ namespace v2rayN.Desktop.Views |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void menuClose_Click(object? sender, RoutedEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
StorageUI(); |
|
|
|
|
|
|
|
ShowHideWindow(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void menuPromotion_Click(object? sender, RoutedEventArgs e) |
|
|
|
private void menuPromotion_Click(object? sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Utils.ProcessStart($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); |
|
|
|
Utils.ProcessStart($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}"); |
|
|
@ -376,8 +379,16 @@ namespace v2rayN.Desktop.Views |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
this.Hide(); |
|
|
|
if (Utils.IsWindows()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.Hide(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.WindowState = WindowState.Minimized; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_config.UiItem.ShowInTaskbar = bl; |
|
|
|
_config.UiItem.ShowInTaskbar = bl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|