mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 22:36:59 +00:00
combine SetupWizardPage and the builder type since the builder mutated an instance of the built type anyways
This commit is contained in:
parent
aba0049a5e
commit
e54cd90adc
6 changed files with 87 additions and 102 deletions
|
|
@ -8,10 +8,10 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace Ryujinx.Ava.Systems.SetupWizard
|
||||
{
|
||||
public partial class SetupWizardPage(bool isFirstPage = false) : BaseModel
|
||||
public partial class SetupWizardPage(ContentPresenter contentPresenter, bool isFirstPage = false) : BaseModel
|
||||
{
|
||||
protected bool? _result;
|
||||
protected readonly CancellationTokenSource _cancellationTokenSource = new();
|
||||
private bool? _result;
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
|
||||
public bool IsFirstPage { get; } = isFirstPage;
|
||||
|
||||
|
|
@ -30,23 +30,23 @@ namespace Ryujinx.Ava.Systems.SetupWizard
|
|||
private void MoveBack()
|
||||
{
|
||||
_result = false;
|
||||
_cancellationTokenSource.Cancel();
|
||||
_cts.Cancel();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void MoveNext()
|
||||
{
|
||||
_result = true;
|
||||
_cancellationTokenSource.Cancel();
|
||||
_cts.Cancel();
|
||||
}
|
||||
|
||||
public async ValueTask<bool> Show(ContentPresenter presenter)
|
||||
public async ValueTask<bool> Show()
|
||||
{
|
||||
presenter.Content = new SetupWizardPageView { DataContext = this, };
|
||||
contentPresenter.Content = new SetupWizardPageView { ViewModel = this };
|
||||
|
||||
try
|
||||
{
|
||||
await Task.Delay(-1, _cancellationTokenSource.Token);
|
||||
await Task.Delay(-1, _cts.Token);
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue