using Avalonia; using Avalonia.Controls; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.ViewModels; namespace Ryujinx.Ava.Systems.SetupWizard { public partial class SetupWizardPage { public SetupWizardPage WithTitle(LocaleKeys title) => WithTitle(LocaleManager.Instance[title]); public SetupWizardPage WithTitle(string title) { Title = title; return this; } public SetupWizardPage WithContent(LocaleKeys content) => WithContent(LocaleManager.Instance[content]); public SetupWizardPage WithContent(object? content) { if (content is StyledElement { Parent: ContentControl parent }) { parent.Content = null; } Content = content; return this; } public SetupWizardPage WithHelpContent(LocaleKeys content) => WithHelpContent(LocaleManager.Instance[content]); public SetupWizardPage WithHelpContent(object? content) { HelpContent = content; return this; } public SetupWizardPage WithContent(object? context = null) where TControl : Control, new() { Content = new TControl { DataContext = context }; return this; } public SetupWizardPage WithContent(out TViewModel boundViewModel) where TControl : RyujinxControl, new() where TViewModel : BaseModel, new() { boundViewModel = new(); return WithContent(boundViewModel); } public SetupWizardPage WithActionContent(LocaleKeys content) => WithActionContent(LocaleManager.Instance[content]); public SetupWizardPage WithActionContent(object? content) { ActionContent = content; return this; } } }