mirror of https://github.com/2dust/v2rayN
Refactor
parent
d7c1516ec2
commit
e71525db0e
|
@ -2,10 +2,8 @@
|
|||
x:Class="v2rayN.Views.AddServer2Window"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Views="clr-namespace:v2rayN.Views"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:v2rayN"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
|
@ -25,11 +23,33 @@
|
|||
TextOptions.TextRenderingMode="Auto"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="8">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Grid.Column="0"
|
||||
Margin="4"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
Cursor="Hand"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</Grid>
|
||||
<ScrollViewer
|
||||
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<Grid Margin="8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -177,30 +197,7 @@
|
|||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="8"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Grid.Column="0"
|
||||
Margin="4"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
IsCancel="true"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</reactiveui:ReactiveWindow>
|
|
@ -1,12 +1,12 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.AddServerWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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: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:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuServers}"
|
||||
|
@ -26,8 +26,8 @@
|
|||
<DockPanel Margin="8">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
|
@ -40,7 +40,6 @@
|
|||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
|
|
|
@ -351,10 +351,5 @@ namespace v2rayN.Views
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,8 +26,8 @@
|
|||
<DockPanel Margin="8">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
|
@ -40,7 +40,6 @@
|
|||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
|
|
|
@ -58,10 +58,5 @@ namespace v2rayN.Views
|
|||
{
|
||||
Utils.ProcessStart("https://sing-box.sagernet.org/zh/configuration/dns/");
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +1,16 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.GlobalHotkeySettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Views="clr-namespace:v2rayN.Views"
|
||||
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: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:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuSetting}"
|
||||
Width="600"
|
||||
Width="700"
|
||||
Height="500"
|
||||
x:TypeArguments="vms:SubEditViewModel"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
|
@ -25,11 +24,40 @@
|
|||
TextOptions.TextRenderingMode="Auto"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="8">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnReset"
|
||||
Grid.Column="0"
|
||||
Margin="4"
|
||||
Click="btnReset_Click"
|
||||
Content="{x:Static resx:ResUI.TbReset}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnSave_Click"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Grid.Column="2"
|
||||
Margin="4"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
IsCancel="true"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</Grid>
|
||||
<ScrollViewer
|
||||
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<Grid Margin="8">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -46,7 +74,7 @@
|
|||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="300" />
|
||||
<ColumnDefinition Width="400" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
|
@ -72,8 +100,8 @@
|
|||
VerticalAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
|
@ -90,8 +118,8 @@
|
|||
VerticalAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
|
@ -108,8 +136,8 @@
|
|||
VerticalAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
|
@ -125,8 +153,8 @@
|
|||
VerticalAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
|
@ -142,8 +170,8 @@
|
|||
VerticalAlignment="Top"
|
||||
AcceptsReturn="True"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
|
||||
PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
|
@ -152,38 +180,7 @@
|
|||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbGlobalHotkeySettingTip}" />
|
||||
|
||||
<Grid
|
||||
Grid.Row="2"
|
||||
Margin="8"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnReset"
|
||||
Grid.Column="0"
|
||||
Margin="4"
|
||||
Click="btnReset_Click"
|
||||
Content="{x:Static resx:ResUI.TbReset}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnSave_Click"
|
||||
Content="{x:Static resx:ResUI.TbConfirm}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Grid.Column="2"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</reactiveui:ReactiveWindow>
|
|
@ -123,11 +123,6 @@ namespace v2rayN.Views
|
|||
}
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnReset_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var k in _TextBoxKeyEventItem.Keys)
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<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:base="clr-namespace:v2rayN.Base"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:v2rayN.Views"
|
||||
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:v2rayN.Resx"
|
||||
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="v2rayN"
|
||||
Width="900"
|
||||
Height="700"
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
<DockPanel Margin="8">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
|
@ -40,7 +40,6 @@
|
|||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
|
|
|
@ -198,10 +198,5 @@ namespace v2rayN.Views
|
|||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||
});
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -139,8 +139,8 @@
|
|||
DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="600" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
|
|
|
@ -81,11 +81,6 @@ namespace v2rayN.Views
|
|||
ViewModel.InboundTagItems = clbInboundTag.SelectedItems.Cast<string>().ToList();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void linkRuleobjectDoc_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Utils.ProcessStart("https://www.v2fly.org/config/routing.html#ruleobject");
|
||||
|
|
|
@ -78,8 +78,8 @@
|
|||
DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="600" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
|
|
|
@ -131,8 +131,8 @@
|
|||
DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="600" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
|
|
|
@ -31,13 +31,10 @@
|
|||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<DockPanel Margin="8">
|
||||
<Grid
|
||||
Margin="8"
|
||||
HorizontalAlignment="Center"
|
||||
DockPanel.Dock="Bottom">
|
||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
x:Name="btnSave"
|
||||
|
@ -50,7 +47,6 @@
|
|||
x:Name="btnCancel"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
Click="btnCancel_Click"
|
||||
Content="{x:Static resx:ResUI.TbCancel}"
|
||||
Cursor="Hand"
|
||||
IsCancel="true"
|
||||
|
|
|
@ -54,10 +54,5 @@ namespace v2rayN.Views
|
|||
{
|
||||
txtRemarks.Focus();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue