IRibbonColorPalette Interface
Implements the base API for a Ribbon’s color palette component.
Namespace: DevExpress.Blazor.Ribbon
Assembly: DevExpress.Blazor.v25.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public interface IRibbonColorPalette :
IRibbonButtonBase<RibbonColorPaletteClickEventArgs>,
IRibbonGroupItem,
IRibbonGroupElement,
IRibbonElement,
IRibbonNode,
IRibbonInteractiveElement,
IRibbonIconSource,
IRibbonClickableItem<RibbonColorPaletteClickEventArgs>
Related API Members
The following members return IRibbonColorPalette objects:
Remarks
Use the IRibbonColorPalette interface to read and modify DxRibbonColorPaletteItem component properties at runtime and customize the Ribbon color palette’s appearance and behavior.
Obtain an IRibbonColorPalette instance with the @ref attribute or from Ribbon event arguments.
The following code snippet gets an IRibbonColorPalette reference and adds an automatic color to the palette:
<DxRibbon>
<DxRibbonTab Text="Home">
<DxRibbonGroup>
<DxRibbonItem Text="Add Automatic Color"
Click="AddAutomaticColor" />
</DxRibbonGroup>
<DxRibbonGroup>
<DxRibbonColorPaletteItem @bind-Value="color"
@ref="colorPaletteReference">
<DxRibbonColorGroup Header="Universal"
Colors="@DxColorPalettePresets.GetPalette(ColorPalettePresetType.Universal)" />
</DxRibbonColorPaletteItem>
</DxRibbonGroup>
</DxRibbonTab>
</DxRibbon>
@code {
string color = "";
IRibbonColorPalette colorPaletteReference;
void AddAutomaticColor(RibbonItemClickEventArgs e)
{
colorPaletteReference.AutomaticColor = "#000000";
colorPaletteReference.AutomaticColorCaption = "Black";
}
}
See Also