您需要覆盖 BarCheckItemLink.CustomResources,然后添加样式以覆盖默认模板。我制作了一个简单的示例来展示这一点:
<dx:DXWindow x:Class="BarCheckItemBackground.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxb:BarManager ToolbarGlyphSize="Large">
<dxb:BarManager.Items>
<dxb:BarCheckItem x:Name="ItemNormal"
Content="I am normal"
Glyph="{dx:DXImage Image=AddItem_16x16.png}"
BarItemDisplayMode="ContentAndGlyph"
LargeGlyph="{dx:DXImage Image=AddItem_32x32.png}" />
<dxb:BarCheckItem x:Name="ItemNotNormal"
Content="I am not normal lol"
Glyph="{dx:DXImage Image=AddItem_16x16.png}"
GroupIndex="-11"
BarItemDisplayMode="ContentAndGlyph"
LargeGlyph="{dx:DXImage Image=AddItem_32x32.png}" />
</dxb:BarManager.Items>
<dxb:BarManager.Bars>
<dxb:Bar>
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Top"/>
</dxb:Bar.DockInfo>
<dxb:BarCheckItemLink BarItemName="ItemNormal" />
<dxb:BarCheckItemLink BarItemName="ItemNotNormal">
<dxb:BarCheckItemLink.CustomResources>
<ResourceDictionary>
<Style TargetType="{x:Type dxb:BarCheckItemLinkControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dxb:BarItemLinkControl}">
<Grid>
<Border Background="Yellow"/>
<dxb:BarItemLayoutPanel x:Name="PART_LayoutPanel"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</dxb:BarCheckItemLink.CustomResources>
</dxb:BarCheckItemLink>
</dxb:Bar>
</dxb:BarManager.Bars>
</dxb:BarManager>
</Grid>
</dx:DXWindow>
和输出窗口:
希望这可以帮助