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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user