2016-01-20 99 views

回答

1

你對它的引用添加使用MergedDictionary語法像這樣,假設下面的代碼是從Style2.xaml

<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:Kliva.XAMLResources"> 

    <ResourceDictionary.MergedDictionaries> 
     <ResourceDictionary Source="Styles.xaml"/> 
    </ResourceDictionary.MergedDictionaries> 

    <Style x:Name="KlivaButton" 
      TargetType="Button"> 
     <Setter Property="Background" Value="{StaticResource KlivaDarkBrush}" /> 
     <Setter Property="Foreground" Value="White" /> 
     <Setter Property="FontFamily" Value="{StaticResource OpenSansFontLight}" /> 
     <Setter Property="FontSize" Value="22" /> 
    </Style> 

</ResourceDictionary> 
+0

它工作。謝謝@Depechie – macgriffiths