mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 07:36:59 +00:00
cleanup
This commit is contained in:
parent
a67da7fd30
commit
bbd11d19d6
8 changed files with 22 additions and 38 deletions
|
|
@ -22,9 +22,7 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
.Show();
|
||||
}
|
||||
|
||||
protected SetupWizardPageBuilder NextPage()
|
||||
{
|
||||
return new SetupWizardPageBuilder(presenter);
|
||||
}
|
||||
protected SetupWizardPageBuilder NextPage()
|
||||
=> new(presenter);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
|||
using CommunityToolkit.Mvvm.Input;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -13,20 +12,19 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
{
|
||||
protected bool? _result;
|
||||
protected readonly CancellationTokenSource _cancellationTokenSource = new();
|
||||
|
||||
|
||||
public bool IsFirstPage { get; } = isFirstPage;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _title;
|
||||
public partial string? Title { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private object? _content;
|
||||
public partial object? Content { get; set; }
|
||||
|
||||
[ObservableProperty] public partial object? HelpContent { get; set; } = "test";
|
||||
|
||||
[ObservableProperty]
|
||||
private object? _helpContent;
|
||||
|
||||
[ObservableProperty]
|
||||
private object? _actionContent = LocaleManager.Instance[LocaleKeys.SetupWizardActionNext];
|
||||
public partial object? ActionContent { get; set; } = LocaleManager.Instance[LocaleKeys.SetupWizardActionNext];
|
||||
|
||||
[RelayCommand]
|
||||
private void MoveBack()
|
||||
|
|
@ -44,15 +42,14 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
|
||||
public async ValueTask<bool> Show(ContentPresenter presenter)
|
||||
{
|
||||
presenter.Content = new SetupWizardPageView
|
||||
{
|
||||
DataContext = this,
|
||||
};
|
||||
presenter.Content = new SetupWizardPageView { DataContext = this, };
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
await Task.Delay(-1, _cancellationTokenSource.Token);
|
||||
}
|
||||
catch (TaskCanceledException) {
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
return _result ?? false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Avalonia;
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.Systems.SetupWizard
|
||||
|
|
@ -28,15 +27,17 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
|
||||
public SetupWizardPageBuilder WithContent(object? content)
|
||||
{
|
||||
if (content is StyledElement { Parent: ContentControl parent }) {
|
||||
if (content is StyledElement { Parent: ContentControl parent })
|
||||
{
|
||||
parent.Content = null;
|
||||
}
|
||||
|
||||
|
||||
_page.Content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SetupWizardPageBuilder WithHelpContent(LocaleKeys content) => WithHelpContent(LocaleManager.Instance[content]);
|
||||
public SetupWizardPageBuilder WithHelpContent(LocaleKeys content) =>
|
||||
WithHelpContent(LocaleManager.Instance[content]);
|
||||
|
||||
public SetupWizardPageBuilder WithHelpContent(object? content)
|
||||
{
|
||||
|
|
@ -46,14 +47,13 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
|
||||
public SetupWizardPageBuilder WithContent<TControl>(object? context = null) where TControl : Control, new()
|
||||
{
|
||||
_page.Content = new TControl {
|
||||
DataContext = context
|
||||
};
|
||||
|
||||
_page.Content = new TControl { DataContext = context };
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public SetupWizardPageBuilder WithActionContent(LocaleKeys content) => WithActionContent(LocaleManager.Instance[content]);
|
||||
public SetupWizardPageBuilder WithActionContent(LocaleKeys content) =>
|
||||
WithActionContent(LocaleManager.Instance[content]);
|
||||
|
||||
public SetupWizardPageBuilder WithActionContent(object? content)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
xmlns:fa="using:Projektanker.Icons.Avalonia"
|
||||
xmlns:wiz="using:Ryujinx.Ava.Systems.SetupWizard"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
|
|
@ -15,7 +13,6 @@
|
|||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
FontFamily="{StaticResource HyliaGlyph}"
|
||||
FontSize="46"
|
||||
Text="{Binding Title}" />
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using Ryujinx.Ava.UI.Controls;
|
||||
|
||||
namespace Ryujinx.Ava.Systems.SetupWizard
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Avalonia.Controls;
|
|||
using Avalonia.Platform.Storage;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Ryujinx.Ava;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Ryujinx.Ava.Common.Locale;
|
|||
using Ryujinx.Ava.Systems.Configuration;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Ava.UI.SetupWizard;
|
||||
using Ryujinx.Ava.UI.SetupWizard.Pages;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using Ryujinx.Ava;
|
||||
using Ryujinx.Ava.Systems.Configuration;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.UI.SetupWizard;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Ava.UI.Windows;
|
||||
using Ryujinx.Common.Configuration;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue