如何设置dev express工具栏背景样式wpf
How to set the dev express toolbar background style wpf
这是我的 xaml,没有为任何 devexpress 控件呈现背景属性。如何覆盖内置属性。
<dxb:ToolBarControl ShowBackground="False" Grid.Row="0" HorizontalAlignment="Stretch"
VerticalAlignment="Top"
AllowCustomizationMenu="True"
BarItemDisplayMode="ContentAndGlyph" UseWholeRow="True"
AllowHide="False" AllowQuickCustomization="False" RotateWhenVertical="False">
<dxb:ToolBarControl.Background>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
<GradientStop Color="#a9546a" Offset="0.1" />
<GradientStop Color="#b4506d" Offset="0.2" />
<GradientStop Color="#9e3763" Offset="0.3" />
<GradientStop Color="#ac4362" Offset="0.5" />
<GradientStop Color="#8a3470" Offset="0.75" />
<GradientStop Color="#753c83" Offset="1.0" />
</LinearGradientBrush>
</dxb:ToolBarControl.Background>
</dxb:ToolBarControl>
要更改 ToolBarControl 的背景,请覆盖 BarControlThemeKey ResourceKey=BarTemplate 资源。
xmlns:dxbt="http://schemas.devexpress.com/winfx/2008/xaml/bars/themekeys"
...
<Window.Resources>
<ControlTemplate x:Key="{dxbt:BarControlThemeKey ResourceKey=BarTemplate, IsThemeIndependent=True}" TargetType="{x:Type ContentControl}">
<Border x:Name="Background" Background="Red">
<ContentPresenter/>
</Border>
</ControlTemplate>
</Window.Resources>
要了解更多关于自定义 DevExpress 资源的信息,请参阅 How to find and change an inner DevExpress control template
这是我的 xaml,没有为任何 devexpress 控件呈现背景属性。如何覆盖内置属性。
<dxb:ToolBarControl ShowBackground="False" Grid.Row="0" HorizontalAlignment="Stretch"
VerticalAlignment="Top"
AllowCustomizationMenu="True"
BarItemDisplayMode="ContentAndGlyph" UseWholeRow="True"
AllowHide="False" AllowQuickCustomization="False" RotateWhenVertical="False">
<dxb:ToolBarControl.Background>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
<GradientStop Color="#a9546a" Offset="0.1" />
<GradientStop Color="#b4506d" Offset="0.2" />
<GradientStop Color="#9e3763" Offset="0.3" />
<GradientStop Color="#ac4362" Offset="0.5" />
<GradientStop Color="#8a3470" Offset="0.75" />
<GradientStop Color="#753c83" Offset="1.0" />
</LinearGradientBrush>
</dxb:ToolBarControl.Background>
</dxb:ToolBarControl>
要更改 ToolBarControl 的背景,请覆盖 BarControlThemeKey ResourceKey=BarTemplate 资源。
xmlns:dxbt="http://schemas.devexpress.com/winfx/2008/xaml/bars/themekeys"
...
<Window.Resources>
<ControlTemplate x:Key="{dxbt:BarControlThemeKey ResourceKey=BarTemplate, IsThemeIndependent=True}" TargetType="{x:Type ContentControl}">
<Border x:Name="Background" Background="Red">
<ContentPresenter/>
</Border>
</ControlTemplate>
</Window.Resources>
要了解更多关于自定义 DevExpress 资源的信息,请参阅 How to find and change an inner DevExpress control template