Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
How can I access igRibbon:XamRibbon.Ribbon in template?
posted

I want to override the control template of RibbonTabItem in RibbonOffice2010Blue.xaml. But I encounter a problem. I cannot access (igRibbon:XamRibbon.Ribbon).SelectedTab.ContextualTabGroup.BaseBackColorResolvedBrush. Because XamRibbon.Ribbon is internal perperty. So, can I do it? Thanks.!

<Border x:Name="contextualSelected" Visibility="Collapsed" CornerRadius="2,2,0,0" BorderThickness="1,1,1,0"
						BorderBrush="{Binding Path=(igRibbon:XamRibbon.Ribbon).SelectedTab.ContextualTabGroup.BaseBackColorResolvedBrush, RelativeSource={x:Static RelativeSource.TemplatedParent}}">
                            <Rectangle Fill="{Binding Path=(igRibbon:XamRibbon.Ribbon).SelectedTab.ContextualTabGroup.BaseBackColorResolvedBrush, RelativeSource={x:Static RelativeSource.TemplatedParent}}">
                                <Rectangle.OpacityMask>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Offset="0" Color="#33c90077"/>
                                                <GradientStop Offset="0.75" Color="#00c90077"/>
                                                <GradientStop Offset="1" Color="#00c90077"/>
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Rectangle.OpacityMask>
                            </Rectangle>
                        </Border>

Parents
No Data
Reply
  • 2680
    Offline posted

    Hi Joey,

    Thank you for posting to Infragistics Community!

    You are on the right track to customizing the look of the RibbonTabItem elements by copying and modifying the default styles. In an effort to reproduce the error you are encountering, I also copied the RibbonTabItem style in a Resource dictionary within a sample app. It appears that some of the namespace declarations from the original style file are needed in order for the parser to not raise the mentioned error:

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"

    For your convenience, I am also attaching the test sample.

    If you require any further assistance on the matter, please, let me know.

    Best regards,
    Bozhidara Pachilova
    Software Developer

    1803.RibbonTabItemStyles.rar

Children
No Data