76671d63d4
* Restructure `Ryujinx.Ava` * Stylistic consistency * Update Ryujinx.Ava/UI/Controls/UserEditor.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Controls/UserEditor.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Controls/UserSelector.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Controls/SaveManager.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Controls/SaveManager.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Helpers/EmbeddedWindow.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Helpers/EmbeddedWindow.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Helpers/EmbeddedWindow.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Helpers/EmbeddedWindow.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/ViewModels/UserProfileViewModel.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/ViewModels/UserProfileViewModel.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/UI/Helpers/EmbeddedWindow.cs Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Fix redundancies * Remove redunancies * Add back elses Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
57 lines
No EOL
1.8 KiB
C#
57 lines
No EOL
1.8 KiB
C#
using Avalonia.Controls;
|
|
using FluentAvalonia.UI.Controls;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
using Ryujinx.Ava.UI.Models;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Ryujinx.Ava.UI.Controls
|
|
{
|
|
public partial class InputDialog : UserControl
|
|
{
|
|
public string Message { get; set; }
|
|
public string Input { get; set; }
|
|
public string SubMessage { get; set; }
|
|
|
|
public uint MaxLength { get; }
|
|
|
|
public InputDialog(string message, string input = "", string subMessage = "", uint maxLength = int.MaxValue)
|
|
{
|
|
Message = message;
|
|
Input = input;
|
|
SubMessage = subMessage;
|
|
MaxLength = maxLength;
|
|
|
|
DataContext = this;
|
|
}
|
|
|
|
public InputDialog()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, string message,
|
|
string input = "", string subMessage = "", uint maxLength = int.MaxValue)
|
|
{
|
|
UserResult result = UserResult.Cancel;
|
|
|
|
InputDialog content = new InputDialog(message, input, subMessage, maxLength);
|
|
ContentDialog contentDialog = new ContentDialog
|
|
{
|
|
Title = title,
|
|
PrimaryButtonText = LocaleManager.Instance["InputDialogOk"],
|
|
SecondaryButtonText = "",
|
|
CloseButtonText = LocaleManager.Instance["InputDialogCancel"],
|
|
Content = content,
|
|
PrimaryButtonCommand = MiniCommand.Create(() =>
|
|
{
|
|
result = UserResult.Ok;
|
|
input = content.Input;
|
|
})
|
|
};
|
|
await contentDialog.ShowAsync();
|
|
|
|
return (result, input);
|
|
}
|
|
}
|
|
} |