sstrong>test.razorобразно
Код: Выделить всё
@inject IDialogService DialogService
@rendermode InteractiveServer
Test
Add
@code {
private void Add() {
var options = new DialogOptions { CloseOnEscapeKey = true };
DialogService.Show("Test", options);
}
}
Код: Выделить всё
Dialog Test
Ok
@code {
[CascadingParameter] MudDialogInstance MudDialog { get; set; }
void Submit() => MudDialog.Close(DialogResult.Ok(true));
}
Код: Выделить всё
@inherits LayoutComponentBase
My Application
@Body
@code {
bool _drawerOpen = true;
void DrawerToggle() {
_drawerOpen = !_drawerOpen;
}
}
< /code>
При нажатии кнопки просмотра ничего не происходит, и никакой ошибки не бросают. Я также попытался добавить @rendermode Interactiveserver Код: Выделить всё
InvalidOperationException: Cannot pass the parameter 'Body' to component 'MainLayout' with rendermode 'InteractiveServerRenderMode'. This is because the parameter is of the delegate type 'Microsoft.AspNetCore.Components.RenderFragment', which is arbitrary code and cannot be serialized
Подробнее здесь: https://stackoverflow.com/questions/779 ... wing-net-8