Class PlaceholderViewPreviewRenderer
The fallback renderer for a view kind no module has registered a renderer for: builds nothing and reports a single explanatory chip in live-render mode, and declines the wireframe entirely so the host draws the same message over the wireframe canvas instead. ViewPreviewRendererRegistry always places this last and its CanRender(UnityViewDefinition) always agrees, so it never shadows a more specific renderer and every definition resolves to something.
Implements
Inherited Members
Namespace: Serenity.Ui.Infrastructure.Editor.Preview.Renderers
Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
Syntax
public sealed class PlaceholderViewPreviewRenderer : IViewPreviewRenderer
Constructors
PlaceholderViewPreviewRenderer()
Declaration
public PlaceholderViewPreviewRenderer()
Fields
NoPreviewMessage
The message shown in both live-render (as a chip) and wireframe (as the canvas message) mode.
Declaration
public const string NoPreviewMessage = "No preview for this view kind. Open it in its authoring tool."
Field Value
| Type | Description |
|---|---|
| string |
Properties
SupportsWireframe
Whether this renderer draws a structural wireframe, or the host shows a placeholder instead.
Declaration
public bool SupportsWireframe { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ViewKindLabel
The toolbar dropdown group label this renderer's definitions are listed under, e.g. "Menus".
Declaration
public string ViewKindLabel { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
CanRender(UnityViewDefinition)
Whether this renderer knows how to draw definition.
Declaration
public bool CanRender(UnityViewDefinition definition)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityViewDefinition | definition | The definition in focus. |
Returns
| Type | Description |
|---|---|
| bool |
DrawWireframe(PreviewWireframeContext)
Draws one structural-wireframe frame. Never called when SupportsWireframe is false.
Declaration
public IReadOnlyList<WireframeOptionHit> DrawWireframe(PreviewWireframeContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| PreviewWireframeContext | context | The wireframe inputs. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<WireframeOptionHit> | The option rows drawn, for the host to hit-test/navigate clicks against. |
Render(PreviewRenderContext)
Builds one live-render frame under CanvasRoot.
Declaration
public PreviewRenderResult Render(PreviewRenderContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| PreviewRenderContext | context | The render inputs. |
Returns
| Type | Description |
|---|---|
| PreviewRenderResult | What the host overlays/hit-tests/paints for this frame. |