oqtane.framework/Oqtane.Client/UI/ModuleInstance.razor
2024-02-09 14:34:33 -05:00

45 lines
1.6 KiB
Plaintext

@namespace Oqtane.UI
@inject SiteState SiteState
@if (PageState.Site.RenderMode == RenderModes.Interactive || ModuleState.RenderMode == RenderModes.Static)
{
<div>Render Mode: @PageState.Site.RenderMode</div><br />
<RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" />
}
else
{
<div>Render Mode: @ModuleState.RenderMode</div><br />
<RenderModeBoundary ModuleState="@ModuleState" PageState="@PageState" SiteState="@SiteState" @rendermode="InteractiveRenderMode.GetInteractiveRenderMode(PageState.Site.Runtime, PageState.Site.Prerender)" />
}
@code {
// this component is on the static side of the render mode boundary
// it passes state as serializable parameters across the boundary so that the state can be used by downstream interactive components
[CascadingParameter]
protected PageState PageState { get; set; }
[CascadingParameter]
private Module ModuleState { get; set; }
[Obsolete("AddModuleMessage is deprecated. Use ModuleBase.AddModuleMessage instead.", false)]
public void AddModuleMessage(string message, MessageType type)
{
}
[Obsolete("AddModuleMessage is deprecated. Use ModuleBase.AddModuleMessage instead.", false)]
public void AddModuleMessage(string message, MessageType type, string position)
{
}
[Obsolete("ShowProgressIndicator is deprecated. Use ModuleBase.ShowProgressIndicator instead.", false)]
public void ShowProgressIndicator()
{
}
[Obsolete("HideProgressIndicator is deprecated. Use ModuleBase.HideProgressIndicator instead.", false)]
public void HideProgressIndicator()
{
}
}