Profiles Select Window (#7891)

* Profiles Select Window

* Sort

* wpf

* avalonia

* Allow single select

* Fix

* Add Config Type Filter

* Remove unnecessary
This commit is contained in:
DHR60
2025-09-07 18:58:59 +08:00
committed by GitHub
parent d18d74ac1c
commit 04195c2957
22 changed files with 1217 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ using Avalonia;
using Avalonia.Interactivity;
using ReactiveUI;
using v2rayN.Desktop.Base;
using System.Threading.Tasks;
namespace v2rayN.Desktop.Views;
@@ -59,4 +60,34 @@ public partial class SubEditWindow : WindowBase<SubEditViewModel>
{
txtRemarks.Focus();
}
private async void BtnSelectPrevProfile_Click(object? sender, RoutedEventArgs e)
{
var selectWindow = new ProfilesSelectWindow();
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
var result = await selectWindow.ShowDialog<bool?>(this);
if (result == true)
{
var profile = await selectWindow.ProfileItem;
if (profile != null)
{
txtPrevProfile.Text = profile.Remarks;
}
}
}
private async void BtnSelectNextProfile_Click(object? sender, RoutedEventArgs e)
{
var selectWindow = new ProfilesSelectWindow();
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
var result = await selectWindow.ShowDialog<bool?>(this);
if (result == true)
{
var profile = await selectWindow.ProfileItem;
if (profile != null)
{
txtNextProfile.Text = profile.Remarks;
}
}
}
}