mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
43 lines
915 B
C#
43 lines
915 B
C#
using Lantean.QBTMud.Models;
|
|
using Microsoft.AspNetCore.Components;
|
|
using MudBlazor;
|
|
|
|
namespace Lantean.QBTMud.Components.Dialogs
|
|
{
|
|
public partial class StringFieldDialog
|
|
{
|
|
[CascadingParameter]
|
|
IMudDialogInstance MudDialog { get; set; } = default!;
|
|
|
|
[Parameter]
|
|
public string? Label { get; set; }
|
|
|
|
[Parameter]
|
|
public string? Value { get; set; }
|
|
|
|
[Parameter]
|
|
public bool Disabled { get; set; }
|
|
|
|
protected void ValueChanged(string value)
|
|
{
|
|
Value = value;
|
|
}
|
|
|
|
protected void Cancel()
|
|
{
|
|
MudDialog.Cancel();
|
|
}
|
|
|
|
protected void Submit()
|
|
{
|
|
MudDialog.Close(DialogResult.Ok(Value));
|
|
}
|
|
|
|
protected override Task Submit(KeyboardEvent keyboardEvent)
|
|
{
|
|
Submit();
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
} |