2014-10-06 70 views
0

ResourceDictionary包含以下标记。如何在wpf中扩展xamoutlookbar主题?

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:flTheme1="Fluent;component/Themes/Office2010" 
        xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent" 
        xmlns:igDP="http://infragistics.com/DataPresenter" 
        xmlns:igEditors="http://infragistics.com/Editors" 
        xmlns:igOB="http://infragistics.com/OutlookBar" 
        xmlns:igOutlookBar="http://infragistics.com/OutlookBar" 
        xmlns:igThemes="http://infragistics.com/Themes" 
        xmlns:igThemes3="clr-namespace:Infragistics.Windows.Themes;assembly=InfragisticsWPF4.OutlookBar.v14.1" 
        xmlns:igThemes4="clr-namespace:Infragistics.Windows.Themes;assembly=InfragisticsWPF4.DataPresenter.v14.1" 
        xmlns:igThemes5="clr-namespace:Infragistics.Windows.Themes;assembly=InfragisticsWPF4.DockManager.v14.1" 
        xmlns:igWindows="http://infragistics.com/Windows" 
        xmlns:local="clr-namespace:Dwm"> 

      <Style TargetType="{x:Type igOB:OutlookBarGroup}" BasedOn="{StaticResource ResourceKey=igThemes3}" > 
     <style> 

</ResourceDictionary> 

如何延长XamOutlookBar主题,这样我可以覆盖OutlookBarGroup的风格和运用是我的风格,以改变它的背景。

回答

2

你为什么不只是设置您的组的背景属性:

<igOB:XamOutlookBar> 
    <igOB:OutlookBarGroup Background="{StaticResource YourBrushResource}"/> 
</igOB:XamOutlookBar> 

如果你想创建一个隐含的风格,我还是建议你只覆盖背景属性:

<Style TargetType="igOB:OutlookBarGroup" BasedOn="{StaticResource {x:Type igOB:OutlookBarGroup}}"> 
    <Setter Property="Background" Value="{StaticResource YourBrushResource}"/> 
</Style> 

最后,如果你想修改控制模板,你可以使用Visual Studio它为How to Extract Default Control Template In Visual Studio?

回答提取