Global style is not applied as expected on the RibbonControl

Posted 2 years ago by Avatar Shraddha Kulkarni


We are trying to have a global style for all RibbonControls in the application. But the style is not getting applied on the ribbonwindows. Attached is the sample application. 


In the below sample, the global style gets applied to the TextBox but not to the RibbonWindow.

Resource fie

<ResourceDictionary xmlns=""
                    xmlns:ribbon=""    >

    <Style TargetType="{x:Type ribbon:RibbonWindow}">
        <Setter Property="IsGlassEnabled" Value="False"/>
        <Setter Property="BorderThickness" Value="10"/>
        <Setter Property="ApplicationName" Value="Dummy Window"/>
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="Red"/>
        <Setter Property="BorderThickness" Value="10"/>



<ribbon:RibbonWindow  x:Class="WpfApplication1.MainWindow"
    xmlns:ribbon=""    >

        <StackPanel Orientation="Vertical">
            <TextBox Text="Text"></TextBox>



Comments (3)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA


I think this is is a description of the problem you are running into here, and it offers a workaround idea:

Actipro Software Support
Posted 1 year ago by Shraddha Kulkarni


This solution offers to have a key. But it will force me to use the key in all XAMLs. Which will not be a practical solution for me. I need to have the style in the common resource file, which will get applied on all the control in the solution without editing each and every xaml file. 

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA


Implicit styles in WPF work for targeting controls, but don't work on targeting Windows.  That's why the suggestions in that StackOverflow article would be necessary for the Window scenario.  It's unfortunately how WPF was designed by Microsoft.

Actipro Software Support
Information The latest build of this product (2018.1 build 0674) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.