mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-07 11:46:26 +02:00
misc: Code cleanup
This commit is contained in:
parent
c69904afc6
commit
281be7ca62
19 changed files with 136 additions and 156 deletions
|
@ -47,42 +47,37 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
LoadProfiles();
|
||||
|
||||
if (contentManager.GetCurrentFirmwareVersion() != null)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
UserFirmwareAvatarSelectorViewModel.PreloadAvatars(contentManager, virtualFileSystem);
|
||||
});
|
||||
}
|
||||
Task.Run(() => UserFirmwareAvatarSelectorViewModel.PreloadAvatars(contentManager, virtualFileSystem));
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
if (ContentFrame.BackStack.Count > 0)
|
||||
{
|
||||
ContentFrame.GoBack();
|
||||
}
|
||||
|
||||
LoadProfiles();
|
||||
}
|
||||
|
||||
public void Navigate(Type sourcePageType, object parameter)
|
||||
{
|
||||
ContentFrame.Navigate(sourcePageType, parameter);
|
||||
}
|
||||
public void Navigate(Type sourcePageType, object parameter)
|
||||
=> ContentFrame.Navigate(sourcePageType, parameter);
|
||||
|
||||
public static async Task Show(AccountManager ownerAccountManager, ContentManager ownerContentManager,
|
||||
VirtualFileSystem ownerVirtualFileSystem, HorizonClient ownerHorizonClient)
|
||||
public static async Task Show(
|
||||
AccountManager ownerAccountManager,
|
||||
ContentManager ownerContentManager,
|
||||
VirtualFileSystem ownerVirtualFileSystem,
|
||||
HorizonClient ownerHorizonClient)
|
||||
{
|
||||
var content = new NavigationDialogHost(ownerAccountManager, ownerContentManager, ownerVirtualFileSystem, ownerHorizonClient);
|
||||
ContentDialog contentDialog = new()
|
||||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = "",
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = string.Empty,
|
||||
Content = content,
|
||||
Padding = new Thickness(0),
|
||||
Padding = new Thickness(0)
|
||||
};
|
||||
|
||||
contentDialog.Closed += (_, _) => content.ViewModel.Dispose();
|
||||
|
@ -160,14 +155,14 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
|
||||
if (profile == null)
|
||||
{
|
||||
Dispatcher.UIThread.Post(Action);
|
||||
|
||||
return;
|
||||
|
||||
static async void Action()
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionWarningMessage]);
|
||||
}
|
||||
|
||||
Dispatcher.UIThread.Post(Action);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
AccountManager.OpenUser(profile.UserId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue