diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml
index ada7a7ca..9b41bc90 100644
--- a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml
@@ -2,15 +2,15 @@
x:Class="v2rayN.Desktop.Views.ProfilesSelectWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:conv="using:v2rayN.Desktop.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
- xmlns:conv="using:v2rayN.Desktop.Converters"
- x:DataType="vms:ProfilesSelectViewModel"
+ Title="{x:Static resx:ResUI.TbSelectProfile}"
Width="800"
Height="450"
- Title="{x:Static resx:ResUI.TbSelectProfile}"
+ x:DataType="vms:ProfilesSelectViewModel"
mc:Ignorable="d">
@@ -18,16 +18,27 @@
-
-
-
-
+
+
+
+
-
-
+
+
+ Text="{Binding ServerFilter, Mode=TwoWay}"
+ Watermark="{x:Static resx:ResUI.MsgServerTitle}" />
-
+
+ ItemsSource="{Binding ProfileItems}"
+ SelectionMode="Single">
-
+
@@ -80,18 +96,38 @@
-
+
-
-
-
-
-
+
+
+
+
+
@@ -99,20 +135,45 @@
-
+
-
+
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs
index 42d34124..5f17603e 100644
--- a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs
+++ b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml.cs
@@ -49,6 +49,25 @@ public partial class ProfilesSelectWindow : ReactiveWindow Close(false);
}
+ public void AllowMultiSelect(bool allow)
+ {
+ if (allow)
+ {
+ lstProfiles.SelectionMode = DataGridSelectionMode.Extended;
+ lstProfiles.SelectedItems.Clear();
+ }
+ else
+ {
+ lstProfiles.SelectionMode = DataGridSelectionMode.Single;
+ if (lstProfiles.SelectedItems.Count > 0)
+ {
+ var first = lstProfiles.SelectedItems[0];
+ lstProfiles.SelectedItems.Clear();
+ lstProfiles.SelectedItem = first;
+ }
+ }
+ }
+
private async Task UpdateViewHandler(EViewAction action, object? obj)
{
switch (action)
diff --git a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml
index e33e3f66..214e1899 100644
--- a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml
+++ b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml
@@ -95,6 +95,7 @@
HeadersVisibility="All"
IsReadOnly="True"
RowHeaderWidth="40"
+ SelectionMode="Single"
Style="{StaticResource DefDataGrid}">
diff --git a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs
index c315ad2d..56ea5f90 100644
--- a/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs
+++ b/v2rayN/v2rayN/Views/ProfilesSelectWindow.xaml.cs
@@ -42,7 +42,25 @@ public partial class ProfilesSelectWindow
this.Bind(ViewModel, vm => vm.SelectedSub, v => v.lstGroup.SelectedItem).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.ServerFilter, v => v.txtServerFilter.Text).DisposeWith(disposables);
});
+ }
+ public void AllowMultiSelect(bool allow)
+ {
+ if (allow)
+ {
+ lstProfiles.SelectionMode = DataGridSelectionMode.Extended;
+ lstProfiles.SelectedItems.Clear();
+ }
+ else
+ {
+ lstProfiles.SelectionMode = DataGridSelectionMode.Single;
+ if (lstProfiles.SelectedItems.Count > 0)
+ {
+ var first = lstProfiles.SelectedItems[0];
+ lstProfiles.SelectedItems.Clear();
+ lstProfiles.SelectedItem = first;
+ }
+ }
}
#region Event