diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs index f3bc6817..8e2ecdbc 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesSelectViewModel.cs @@ -277,6 +277,33 @@ public class ProfilesSelectViewModel : MyReactiveObject return item; } + public async Task?> GetProfileItems() + { + if (SelectedProfiles == null || SelectedProfiles.Count == 0) + { + return null; + } + var lst = new List(); + foreach (var sp in SelectedProfiles) + { + if (string.IsNullOrEmpty(sp?.IndexId)) + { + continue; + } + var item = await AppManager.Instance.GetProfileItem(sp.IndexId); + if (item != null) + { + lst.Add(item); + } + } + if (lst.Count == 0) + { + NoticeManager.Instance.Enqueue(ResUI.PleaseSelectServer); + return null; + } + return lst; + } + public void SortServer(string colName) { if (colName.IsNullOrEmpty()) diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml index 9b41bc90..db5a017f 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesSelectWindow.axaml @@ -11,6 +11,7 @@ Width="800" Height="450" x:DataType="vms:ProfilesSelectViewModel" + WindowStartupLocation="CenterScreen" mc:Ignorable="d"> @@ -27,6 +28,7 @@