我有几种常见的样式,我想在Windows 8.1应用程序的几个页面中共享它们.
我知道我可以用merge dictionaries选项实现,但我不知道如何使用在字典中定义的样式.
我试过这个:
<Page.Resources>
<ResourceDictionary x:Key="lol">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Generic.xaml" />
<ResourceDictionary>
<Style x:Key="TextViewAllStyle" TargetType="TextBlock">
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="TextViewAllStyle2" TargetType="TextBlock">
</Style>
</ResourceDictionary>
<Style x:Key="TextViewAllStyle3" TargetType="TextBlock">
</Style>
</Page.Resources>
Run Code Online (Sandbox Code Playgroud)
但我的Visual Studio只看到第三个...
<TextBlock Style="{StaticResource ResourceKey=TextViewAllStyle3}"/>
Run Code Online (Sandbox Code Playgroud)