2017-10-15 71 views

回答

1

我已經解決了這個問題。我已經在App構造函數中添加此補充一些全球resource qualifiers

if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5)) 
{ 
    ResourceContext.SetGlobalQualifierValue("Custom", "Fluent"); 
} 

然後我創建了兩個不同的資源字典,一個流利,一個用於無流利的XAML。這些文件是這樣命名的:

MyResourceDictionary.xaml 
MyResourceDictionary.Custom-Fluent.xaml 

你可以用它做很多事情。但據我所知,根據像AcrylicBrush這樣的新類型創建自定義資源是不可能的,即使使用conditional XAML(至少在創作者更新之前想要支持版本時也是如此)。相反,我正在使用像這樣的現有資源:

<StaticResource x:Key="MyCustomBrush" 
       ResourceKey="SystemControlAcrylicElementBrush" />