mirror of https://github.com/2dust/v2rayN
Refactor click event
parent
6c9db51fd5
commit
639d62588a
|
@ -1,9 +1,9 @@
|
|||
<Application
|
||||
x:Class="v2rayN.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
StartupUri="Views/MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
|
|
@ -179,7 +179,6 @@
|
|||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Margin="4,0"
|
||||
Click="btnGUID_Click"
|
||||
Content="{x:Static resx:ResUI.TbGUID}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
|
||||
|
@ -339,7 +338,6 @@
|
|||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Margin="4,0"
|
||||
Click="btnGUID_Click"
|
||||
Content="{x:Static resx:ResUI.TbGUID}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ namespace v2rayN.Views
|
|||
this.Loaded += Window_Loaded;
|
||||
cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged;
|
||||
cmbStreamSecurity.SelectionChanged += CmbStreamSecurity_SelectionChanged;
|
||||
btnGUID.Click += btnGUID_Click;
|
||||
btnGUID5.Click += btnGUID_Click;
|
||||
|
||||
ViewModel = new AddServerViewModel(profileItem, UpdateViewHandler);
|
||||
|
||||
|
|
|
@ -34,13 +34,11 @@
|
|||
x:Name="btnReset"
|
||||
Width="100"
|
||||
Margin="8,0"
|
||||
Click="btnReset_Click"
|
||||
Content="{x:Static resx:ResUI.TbReset}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Width="100"
|
||||
Click="btnSave_Click"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
Cursor="Hand"
|
||||
Style="{StaticResource DefButton}" />
|
||||
|
|
|
@ -15,10 +15,14 @@ namespace v2rayN.Views
|
|||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
_config = LazyConfig.Instance.Config;
|
||||
_config.globalHotkeys ??= new List<KeyEventItem>();
|
||||
|
||||
btnReset.Click += btnReset_Click;
|
||||
btnSave.Click += btnSave_Click;
|
||||
|
||||
txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
|
||||
txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
|
||||
txtGlobalHotkey2.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="v2rayN"
|
||||
Width="900"
|
||||
Height="700"
|
||||
|
@ -57,6 +57,14 @@
|
|||
<TextBlock Text="{x:Static resx:ResUI.menuServers}" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
<MenuItem
|
||||
x:Name="menuAddServerViaClipboard"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddServerViaScan"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddServerViaScan}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddCustomServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
|
@ -99,15 +107,6 @@
|
|||
x:Name="menuAddWireguardServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddWireguardServer}" />
|
||||
<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuAddServerViaClipboard"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddServerViaClipboard}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddServerViaScan"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddServerViaScan}" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<Separator />
|
||||
|
@ -181,7 +180,6 @@
|
|||
<MenuItem
|
||||
x:Name="menuSettingsSetUWP"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuSettingsSetUWP_Click"
|
||||
Header="{x:Static resx:ResUI.TbSettingsSetUWP}" />
|
||||
<MenuItem
|
||||
x:Name="menuClearServerStatistics"
|
||||
|
@ -263,10 +261,7 @@
|
|||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem
|
||||
x:Name="menuPromotion"
|
||||
Padding="8,0"
|
||||
Click="menuPromotion_Click">
|
||||
<MenuItem x:Name="menuPromotion" Padding="8,0">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
|
@ -280,10 +275,7 @@
|
|||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem
|
||||
x:Name="menuClose"
|
||||
Padding="8,0"
|
||||
Click="menuClose_Click">
|
||||
<MenuItem x:Name="menuClose" Padding="8,0">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
|
@ -638,7 +630,6 @@
|
|||
<MenuItem
|
||||
x:Name="menuExit"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuExit_Click"
|
||||
Header="{x:Static resx:ResUI.menuExit}" />
|
||||
</ContextMenu>
|
||||
</tb:TaskbarIcon.ContextMenu>
|
||||
|
|
|
@ -26,6 +26,10 @@ namespace v2rayN.Views
|
|||
App.Current.SessionEnding += Current_SessionEnding;
|
||||
this.Closing += MainWindow_Closing;
|
||||
this.PreviewKeyDown += MainWindow_PreviewKeyDown;
|
||||
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click;
|
||||
menuPromotion.Click += menuPromotion_Click;
|
||||
menuClose.Click += menuClose_Click;
|
||||
menuExit.Click += menuExit_Click;
|
||||
|
||||
MessageBus.Current.Listen<string>(Global.CommandSendSnackMsg).Subscribe(x => DelegateSnackMsg(x));
|
||||
ViewModel = new MainWindowViewModel(UpdateViewHandler);
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
Width="24"
|
||||
Height="24"
|
||||
Margin="8,0"
|
||||
Click="menuMsgViewCopyAll_Click"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||
ToolTip="{x:Static resx:ResUI.menuMsgViewCopyAll}">
|
||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentCopy" />
|
||||
|
@ -40,7 +39,6 @@
|
|||
Width="24"
|
||||
Height="24"
|
||||
Margin="8,0"
|
||||
Click="menuMsgViewClear_Click"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||
ToolTip="{x:Static resx:ResUI.menuMsgViewClear}">
|
||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Delete" />
|
||||
|
@ -81,22 +79,18 @@
|
|||
<MenuItem
|
||||
x:Name="menuMsgViewSelectAll"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuMsgViewSelectAll_Click"
|
||||
Header="{x:Static resx:ResUI.menuMsgViewSelectAll}" />
|
||||
<MenuItem
|
||||
x:Name="menuMsgViewCopy"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuMsgViewCopy_Click"
|
||||
Header="{x:Static resx:ResUI.menuMsgViewCopy}" />
|
||||
<MenuItem
|
||||
x:Name="menuMsgViewCopyAll"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuMsgViewCopyAll_Click"
|
||||
Header="{x:Static resx:ResUI.menuMsgViewCopyAll}" />
|
||||
<MenuItem
|
||||
x:Name="menuMsgViewClear"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuMsgViewClear_Click"
|
||||
Header="{x:Static resx:ResUI.menuMsgViewClear}" />
|
||||
</ContextMenu>
|
||||
</TextBox.ContextMenu>
|
||||
|
|
|
@ -17,6 +17,14 @@ namespace v2rayN.Views
|
|||
InitializeComponent();
|
||||
_config = LazyConfig.Instance.Config;
|
||||
MessageBus.Current.Listen<string>(Global.CommandSendMsgView).Subscribe(x => DelegateAppendText(x));
|
||||
|
||||
btnCopy.Click += menuMsgViewCopyAll_Click;
|
||||
btnClear.Click += menuMsgViewClear_Click;
|
||||
menuMsgViewSelectAll.Click += menuMsgViewSelectAll_Click;
|
||||
menuMsgViewCopy.Click += menuMsgViewCopy_Click;
|
||||
menuMsgViewCopyAll.Click += menuMsgViewCopyAll_Click;
|
||||
menuMsgViewClear.Click += menuMsgViewClear_Click;
|
||||
|
||||
Global.PresetMsgFilters.ForEach(it =>
|
||||
{
|
||||
cmbMsgFilter.Items.Add(it);
|
||||
|
|
|
@ -189,7 +189,6 @@
|
|||
<MenuItem
|
||||
x:Name="menuSelectAll"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuSelectAll_Click"
|
||||
Header="{x:Static resx:ResUI.menuSelectAll}" />
|
||||
<Separator />
|
||||
<MenuItem Header="{x:Static resx:ResUI.menuExport2ClientConfig}">
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace v2rayN.Views
|
|||
lstProfiles.PreviewKeyDown += LstProfiles_PreviewKeyDown;
|
||||
lstProfiles.SelectionChanged += lstProfiles_SelectionChanged;
|
||||
lstProfiles.LoadingRow += LstProfiles_LoadingRow;
|
||||
menuSelectAll.Click += menuSelectAll_Click;
|
||||
|
||||
if (_config.uiItem.enableDragDropSort)
|
||||
{
|
||||
lstProfiles.AllowDrop = true;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.RoutingRuleSettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
|
||||
Width="960"
|
||||
Height="700"
|
||||
|
@ -213,7 +213,6 @@
|
|||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Margin="2,0,8,0"
|
||||
Click="btnBrowseCustomIcon_Click"
|
||||
Content="{x:Static resx:ResUI.TbBrowse}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
|
||||
|
@ -243,7 +242,6 @@
|
|||
Grid.Row="4"
|
||||
Grid.Column="2"
|
||||
Margin="2,0,8,0"
|
||||
Click="btnBrowseCustomRulesetPath4Singbox_Click"
|
||||
Content="{x:Static resx:ResUI.TbBrowse}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</Grid>
|
||||
|
@ -275,7 +273,6 @@
|
|||
<MenuItem
|
||||
x:Name="menuRuleSelectAll"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuRuleSelectAll_Click"
|
||||
Header="{x:Static resx:ResUI.menuSelectAll}" />
|
||||
<MenuItem
|
||||
x:Name="menuRuleExportSelected"
|
||||
|
|
|
@ -16,6 +16,9 @@ namespace v2rayN.Views
|
|||
this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown;
|
||||
lstRules.SelectionChanged += lstRules_SelectionChanged;
|
||||
lstRules.MouseDoubleClick += LstRules_MouseDoubleClick;
|
||||
menuRuleSelectAll.Click += menuRuleSelectAll_Click;
|
||||
btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
|
||||
btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_Click;
|
||||
|
||||
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
|
||||
Global.DomainStrategies.ForEach(it =>
|
||||
|
|
|
@ -148,7 +148,6 @@
|
|||
x:Name="btnCancel"
|
||||
Width="100"
|
||||
Margin="8,0"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
|
@ -184,7 +183,6 @@
|
|||
<MenuItem
|
||||
x:Name="menuRoutingAdvancedSelectAll"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Click="menuRoutingAdvancedSelectAll_Click"
|
||||
Header="{x:Static resx:ResUI.menuSelectAll}" />
|
||||
<MenuItem
|
||||
x:Name="menuRoutingAdvancedSetDefault"
|
||||
|
|
|
@ -16,6 +16,8 @@ namespace v2rayN.Views
|
|||
this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown;
|
||||
lstRoutings.SelectionChanged += lstRoutings_SelectionChanged;
|
||||
lstRoutings.MouseDoubleClick += LstRoutings_MouseDoubleClick;
|
||||
menuRoutingAdvancedSelectAll.Click += menuRoutingAdvancedSelectAll_Click;
|
||||
btnCancel.Click += btnCancel_Click;
|
||||
|
||||
ViewModel = new RoutingSettingViewModel(UpdateViewHandler);
|
||||
|
||||
|
|
|
@ -73,10 +73,7 @@
|
|||
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubShare}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="menuClose"
|
||||
Click="menuClose_Click"
|
||||
IsCancel="True">
|
||||
<Button x:Name="menuClose" IsCancel="True">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
Margin="0,0,8,0"
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace v2rayN.Views
|
|||
this.Closing += SubSettingWindow_Closing;
|
||||
lstSubscription.MouseDoubleClick += LstSubscription_MouseDoubleClick;
|
||||
lstSubscription.SelectionChanged += LstSubscription_SelectionChanged;
|
||||
menuClose.Click += menuClose_Click;
|
||||
|
||||
this.WhenActivated(disposables =>
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace v2rayN.Views
|
|||
InitializeComponent();
|
||||
ViewModel = new ThemeSettingViewModel();
|
||||
|
||||
for (int i = Global.MinFontSize; i <= Global.MinFontSize + 8; i++)
|
||||
for (int i = Global.MinFontSize; i <= Global.MinFontSize + 10; i++)
|
||||
{
|
||||
cmbCurrentFontSize.Items.Add(i.ToString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue