Add AppViewModel for Desktop

This commit is contained in:
2dust
2024-10-06 21:16:17 +08:00
parent 4d84eede56
commit f40eb724d7
3 changed files with 62 additions and 37 deletions

View File

@@ -2,9 +2,10 @@
x:Class="v2rayN.Desktop.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:v2rayN.Desktop.ViewModels"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
x:DataType="local:AppViewModel"
RequestedThemeVariant="Default">
<Application.Styles>
<StyleInclude Source="Styles/GlobalStyles.axaml" />
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
@@ -32,13 +33,13 @@
ToolTipText="v2rayN Desktop">
<TrayIcon.Menu>
<NativeMenu>
<NativeMenuItem Click="MenuAddServerViaClipboardClick" Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
<NativeMenuItem Command="{Binding AddServerViaClipboardCmd}" Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
<NativeMenuItem Header="{x:Static resx:ResUI.menuAddServerViaScan}" IsVisible="False" />
<NativeMenuItem Click="MenuSubUpdate_Click" Header="{x:Static resx:ResUI.menuSubUpdate}" />
<NativeMenuItem Click="MenuSubUpdateViaProxy_Click" Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" />
<NativeMenuItem Command="{Binding SubUpdateCmd}" Header="{x:Static resx:ResUI.menuSubUpdate}" />
<NativeMenuItem Command="{Binding SubUpdateViaProxyCmd}" Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" />
<NativeMenuItemSeparator />
<NativeMenuItem Click="TrayIcon_Clicked" Header="{x:Static resx:ResUI.menuShowOrHideMainWindow}" />
<NativeMenuItem Click="MenuExit_Click" Header="{x:Static resx:ResUI.menuExit}" />
<NativeMenuItem Command="{Binding ExitCmd}" Header="{x:Static resx:ResUI.menuExit}" />
</NativeMenu>
</TrayIcon.Menu>
</TrayIcon>