@using MudBlazor Create New Folder Cancel Create @code { [CascadingParameter] IMudDialogInstance Dialog { get; set; } = null!; private string FolderName { get; set; } = string.Empty; private void Cancel() => Dialog.Cancel(); private void Submit() { if (string.IsNullOrWhiteSpace(FolderName)) { return; } Dialog.Close(DialogResult.Ok(FolderName.Trim())); } private void HandleKeyDown(KeyboardEventArgs e) { if (e.Key == "Enter") { Submit(); } else if (e.Key == "Escape") { Cancel(); } } }