2014-10-06 93 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?

回答提取