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?
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.
Ok, i now understand. I set the theme of the OutlookBar to Office2k7Black and override some of the styles
by definining OutlookBar.Resources. As for the local style i also understand, however is there a possibility to define a theme for OutlookBar and define an OutlookBar .Resources for e.g. SelectedGroupHeader, GroupAreaSplitter where the styles point to the resourcedictionary?
Nevermind this post, i found it out. :)
If you mean that you have resources (styles, etc.) that you put into the OutlookBar.Resources but instead want to put them into a separate resource dictionary, then yes you can do this. Instead of putting the resources directly in the OutlookBar.Resources, you would put a ResourceDictionary into the OutlookBar.Resources.MergedDictionaries and set the Source of that ResourceDictionary to the uri to your ResourceDictionary file.