Avalonia: Cleanup UserEditor a bit (#3492)

This PR cleanup the UserEditor code a bit, 2 texts are added for "Name" and "User Id", because when you create a new profile, the textbox is empty without any hints. `axaml` files are autoformated too.
This commit is contained in:
Ac_K 2022-07-28 19:16:23 +02:00 committed by GitHub
parent 37b6e081da
commit 8cfec5de4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 131 additions and 85 deletions

View file

@ -43,11 +43,9 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
}
public bool IsHighlightedProfileEditable =>
_highlightedProfile != null;
public bool IsHighlightedProfileEditable => _highlightedProfile != null;
public bool IsHighlightedProfileDeletable =>
_highlightedProfile != null && _highlightedProfile.UserId != AccountManager.DefaultUserId;
public bool IsHighlightedProfileDeletable => _highlightedProfile != null && _highlightedProfile.UserId != AccountManager.DefaultUserId;
public UserProfile HighlightedProfile
{
@ -62,16 +60,13 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
}
public void Dispose()
{
}
public void Dispose() { }
public void LoadProfiles()
{
Profiles.Clear();
var profiles = _owner.AccountManager.GetAllUsers()
.OrderByDescending(x => x.AccountState == AccountState.Open);
var profiles = _owner.AccountManager.GetAllUsers().OrderByDescending(x => x.AccountState == AccountState.Open);
foreach (var profile in profiles)
{
@ -94,6 +89,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
public void AddUser()
{
UserProfile userProfile = null;
_owner.Navigate(typeof(UserEditor), (this._owner, userProfile, true));
}