Set Style in XAML

Ribbon for WPF Forum

Posted 12 years ago by Matt
Avatar
I set various static properties as follows:

ActiproSoftware.Windows.Controls.Ribbon.UI.RibbonColorScheme.Office2007Black.RibbonControlOuterBorderHover1 = Colors.DarkGray; ActiproSoftware.Windows.Controls.Ribbon.UI.RibbonColorScheme.Office2007Black.RibbonControlOuterBorderHover2= Colors.DarkGray; ActiproSoftware.Windows.Controls.Ribbon.UI.RibbonColorScheme.Office2007Black.RibbonControlOuterBorderHover3 = Colors.DarkGray;

Is there a way to set this in XAML it would give me more flexibility as I could choose which to apply.

Matt

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes the color scheme itself is the lowest level of customization. Each of those colors is used by a Brush resource which you can override. And that you could do in XAML.

For instance, here is what we have now by default for those colors:

<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ribbon:Ribbon},ResourceId=RibbonControlOuterBorderHoverBrush}" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0" Color="{ribbonUI:RibbonColor RibbonControlOuterBorderHover1}" />
    <GradientStop Offset="0.5" Color="{ribbonUI:RibbonColor RibbonControlOuterBorderHover2}" />
    <GradientStop Offset="1" Color="{ribbonUI:RibbonColor RibbonControlOuterBorderHover3}" />
</LinearGradientBrush>
You could override that with the same Key in a resources of your own at any level to change the brush that is used. Does that answer your question?


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.