UserProfile.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Ryujinx.Ava.Ui.ViewModels;
  2. using Ryujinx.HLE.HOS.Services.Account.Acc;
  3. using Profile = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
  4. namespace Ryujinx.Ava.Ui.Models
  5. {
  6. public class UserProfile : BaseModel
  7. {
  8. private readonly Profile _profile;
  9. private byte[] _image;
  10. private string _name;
  11. private UserId _userId;
  12. public byte[] Image
  13. {
  14. get => _image;
  15. set
  16. {
  17. _image = value;
  18. OnPropertyChanged();
  19. }
  20. }
  21. public UserId UserId
  22. {
  23. get => _userId;
  24. set
  25. {
  26. _userId = value;
  27. OnPropertyChanged();
  28. }
  29. }
  30. public string Name
  31. {
  32. get => _name;
  33. set
  34. {
  35. _name = value;
  36. OnPropertyChanged();
  37. }
  38. }
  39. public UserProfile(Profile profile)
  40. {
  41. _profile = profile;
  42. Image = profile.Image;
  43. Name = profile.Name;
  44. UserId = profile.UserId;
  45. }
  46. public bool IsOpened => _profile.AccountState == AccountState.Open;
  47. public void UpdateState()
  48. {
  49. OnPropertyChanged(nameof(IsOpened));
  50. OnPropertyChanged(nameof(Name));
  51. }
  52. }
  53. }