Style with dataTemplate doesn't work so well...

Topics: Prism v2 - WPF 4
Jun 29, 2011 at 4:20 PM
Edited Jun 29, 2011 at 4:21 PM

I styled a RibbonTab's Header ( spacing) with a dataTemplate the issue is that when working with regions the style is applied but the RibbonGroups dissapear while this  works fine without regions i also have set  the background for the RibbonTab and that works fine even with regions....



Jun 29, 2011 at 5:20 PM
Edited Jun 29, 2011 at 5:20 PM


The issue you're experiencing might be related to the issue discussed in this work item:

Menu regions + themes

I hope you find this helpful.

Guido Leandro Maliandi

Jun 29, 2011 at 6:19 PM
Edited Jun 29, 2011 at 6:21 PM

I think my issue it's a little bit different because this works fine without regions...

Here is the style i apply and the brush for the background, targetType doesn't work on both cases but this does work: "Background="{DynamicResource ribbonBackground}"

while this doesn't : Style="{DynamicResource TabIndices}"

The resources:

<LinearGradientBrush x:Key="ribbonBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFDEEBFF" Offset="0"/>
        <GradientStop Color="#FFEFFBFF" Offset="1"/>
        <GradientStop Color="#FFCEDBEF" Offset="0.248"/>
        <GradientStop Color="#FFCEDFF7" Offset="0.589"/>

    <indices:StringConverter x:Key="myConverter"/>
    <indices:EmptyHeaderCheck x:Key="emptyHeader"/>

    <Style x:Key="TabIndices" TargetType="{x:Type telerik:RadRibbonTab}">
        <Setter Property="HeaderTemplate">
                <DataTemplate x:Name="HeaderGlyphs">
                          FontUri  = "C:\WINDOWS\Fonts\SEGOEUI.TTF"
                          FontRenderingEmSize = "11"
                          UnicodeString = "{Binding Converter={StaticResource emptyHeader}}"
                          Indices  = "{Binding Path=UnicodeString, Converter={StaticResource myConverter}, RelativeSource={RelativeSource Self}}"
                          Fill  = "#FF0C386B">

The Ribbontab:



    Header="Some Header with custom spacing"
    Style="{DynamicResource TabIndices}"
    Background="{DynamicResource ribbonBackground}"