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;
}
}
Если я попытаюсь добавить @rendermode InteractiveServer в MainLayout.razor, я получаю следующую ошибку:
Код: Выделить всё
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
Мое приложение в настоящее время настроено для работы только в режиме рендеринга Interactive Servcer. Есть ли что-то действительно очевидное, что я упускаю из виду?
Подробнее здесь: https://stackoverflow.com/questions/779 ... wing-net-8