Back to Devexpress

BlazorControlViewItem Class

expressappframework-devexpress-dot-expressapp-dot-blazor-dot-editors-ca322c17.md

latest3.5 KB
Original Source

BlazorControlViewItem Class

A container for custom ASP.NET Core Blazor components displayed in a Detail View.

Namespace : DevExpress.ExpressApp.Blazor.Editors

Assembly : DevExpress.ExpressApp.Blazor.v25.2.dll

NuGet Package : DevExpress.ExpressApp.Blazor

Declaration

csharp
public class BlazorControlViewItem :
    ControlViewItem
vb
Public Class BlazorControlViewItem
    Inherits ControlViewItem

Remarks

The following code snippet uses BlazorControlViewItem to create a custom component:

File: CS\MainDemo.Blazor.Server\Editors\ButtonComponent.razor

razor
@using DevExpress.Blazor
@using DevExpress.ExpressApp
@using DevExpress.ExpressApp.Blazor.Editors

<DxButton Text="Click me!" Click=@ClickFromUI />

@code {
    [CascadingParameter] public BlazorControlViewItem ViewItem { get; set; }

    void ClickFromUI() {
        ViewItem.Application.ShowViewStrategy.ShowMessage("Action is executed!");
    }
}

When you add the custom component to a Detail View, specify the component type as the ControlTypeName property value in the Model Editor:

For more information about custom ASP.NET Core Blazor View Items, refer to the following topics:

Implements

IComplexViewItem

Inheritance

Object ViewItem ControlViewItem BlazorControlViewItem

See Also

BlazorControlViewItem Members

How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Fully Custom ViewItem)

How to: Show a Custom Data-Bound Control in an XAF View (Blazor) - Current Object Data

How to: Show a Custom Data-Bound Control in an XAF View (Blazor) - External Data

DevExpress.ExpressApp.Blazor.Editors Namespace