mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-19 19:36:58 +00:00
Fix "No Profiles To Recover" not updating in certain instances
"No Profiles To Recover" text did not show up after saving the recovered profile, as the user is still on the "Profile Recovery" window. This now updates this.
This commit is contained in:
parent
de11115971
commit
928a189d99
1 changed files with 16 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
|
|
@ -11,23 +11,32 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
Profiles = new ObservableCollection<BaseModel>();
|
Profiles = new ObservableCollection<BaseModel>();
|
||||||
LostProfiles = new ObservableCollection<UserProfile>();
|
LostProfiles = new ObservableCollection<UserProfile>();
|
||||||
|
LostProfiles.CollectionChanged += LostProfilesChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<BaseModel> Profiles { get; set; }
|
public ObservableCollection<BaseModel> Profiles { get; }
|
||||||
|
|
||||||
public ObservableCollection<UserProfile> LostProfiles { get; set; }
|
public ObservableCollection<UserProfile> LostProfiles { get; }
|
||||||
|
|
||||||
public bool IsEmpty => !LostProfiles.Any();
|
public bool IsEmpty => LostProfiles.Count == 0;
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
GC.SuppressFinalize(this);
|
LostProfiles.CollectionChanged -= LostProfilesChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LostProfilesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
OnPropertyChanged(nameof(IsEmpty));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateLostProfiles(ObservableCollection<UserProfile> newProfiles)
|
public void UpdateLostProfiles(ObservableCollection<UserProfile> newProfiles)
|
||||||
{
|
{
|
||||||
LostProfiles = newProfiles;
|
LostProfiles.Clear();
|
||||||
OnPropertyChanged(nameof(LostProfiles));
|
|
||||||
|
foreach (var profile in newProfiles)
|
||||||
|
LostProfiles.Add(profile);
|
||||||
|
|
||||||
OnPropertyChanged(nameof(IsEmpty));
|
OnPropertyChanged(nameof(IsEmpty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue