Back to Devexpress

IRibbon Interface

blazor-devexpress-dot-blazor-dot-ribbon.md

latest1.7 KB
Original Source

IRibbon Interface

Defines the programmatic interface for the DxRibbon component.

Namespace : DevExpress.Blazor.Ribbon

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public interface IRibbon :
    IRibbonNode,
    IRibbonTabs,
    IRibbonParameters,
    IRibbonAdaptivityParameters,
    IRibbonTabParameters,
    IRibbonStyleParameters,
    IRibbonSizeConstraints,
    IRibbonEvents,
    IRibbonBaseEvents

Remarks

Use the IRibbon interface to read and modify DxRibbon component properties at runtime and customize the Ribbon’s appearance and behavior. Obtain an IRibbon instance with the @ref attribute or from Ribbon event arguments.

The following code snippet gets an IRibbon reference and toggles the visibility of the Insert tab:

razor
<DxRibbon @ref="ribbonRef">
    <DxRibbonTab Text="Home">
        <DxRibbonGroup>
            <DxRibbonItem Text="Toggle Insert Tab"
                          Click="ToggleInsertTab" />
        </DxRibbonGroup>
    </DxRibbonTab>
    <DxRibbonTab Text="Insert" Visible="false">
        <!-- ... -->
    </DxRibbonTab>
</DxRibbon>

@code {
    IRibbon ribbonRef;

    void ToggleInsertTab(RibbonItemClickEventArgs e) {
        var insertTab = ribbonRef.Tabs.ElementAt(1);
        insertTab.Visible = !insertTab.Visible;
    }
}

See Also

IRibbon Members

DevExpress.Blazor.Ribbon Namespace