From 8cfec5de4bde7087734beb2f7203f0d930e1b2d8 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Thu, 28 Jul 2022 19:16:23 +0200 Subject: 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. --- Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs') diff --git a/Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs index f7a50077..a48b06e6 100644 --- a/Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/UserProfileViewModel.cs @@ -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)); } -- cgit v1.2.3