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
275
Placing styles in ResourceDictionary
posted

I have an outlookbar with resources:

<igOB:XamOutlookBar x:Name="xamOutlookBar" Panel.ZIndex="1" Width="195" IsTabStop="False"">
    <igOB:XamOutlookBar.Resources>
     <Style TargetType="{x:Type igOB:SelectedGroupHeader}">
                <Setter Property="Background">
                  <Setter.Value>
       <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFF6F7F2"/>
        <GradientStop Color="#FFD8DDE8" Offset="0.988"/>
       </LinearGradientBrush>
      </Setter.Value>
                </Setter>
       <Setter Property="FontFamily" Value="Calibri"/>
       <Setter Property="FontSize" Value="14"/>
</Style></igOB:XamOutlookBar>

I then place the style in a resource dictionary file but it doesn't work. What am i doing wrong?

Parents
  • 54937
    Suggested Answer
    Offline posted

    As long as the resourcedictionary is in the ancesor chain of the outlookbar or in the application's resources this should work. Note, if you have assigned the Theme property of the xamOutlookBar then your style won't get picked up since setting a Theme puts a ResourceDictionary that contains all the theme's resources into the control's Resources file and therefore that becomes the local style for the classes (since WPF only supports 1 local style). If you still have an issue then please post a project that demonstrates the problem and we can look into this further.

Reply Children