web UI
This commit is contained in:
27
VisionBuilder.UI.Blazor/Dialogs/PasswordInputDialog.razor
Normal file
27
VisionBuilder.UI.Blazor/Dialogs/PasswordInputDialog.razor
Normal file
@@ -0,0 +1,27 @@
|
||||
@using MudBlazor
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudTextField @bind-Value="_password" Label="Password" InputType="InputType.Password"
|
||||
Immediate="true" OnKeyDown="OnKeyDown" AutoFocus="true" />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" OnClick="Submit">OK</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
|
||||
|
||||
private string _password = "";
|
||||
|
||||
private void Submit() => MudDialog.Close(DialogResult.Ok(_password));
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Key == "Enter")
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user