Initial commit: Tasks.Module
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudTextField @bind-Value="_value" Label="@Label" Required="true" Class="mb-3" />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" OnClick="Submit">Save</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
private string _value = string.Empty;
|
||||
|
||||
[Parameter] public string Title { get; set; } = string.Empty;
|
||||
[Parameter] public string Label { get; set; } = string.Empty;
|
||||
[Parameter] public string? Value { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
private IMudDialogInstance? MudDialog { get; set; }
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_value = Value ?? string.Empty;
|
||||
}
|
||||
|
||||
private void Submit()
|
||||
{
|
||||
if (MudDialog != null && !string.IsNullOrWhiteSpace(_value))
|
||||
{
|
||||
MudDialog.Close(DialogResult.Ok(_value));
|
||||
}
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
MudDialog?.Cancel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user