WP8中引用资源字典
当我们定义的样式太多的时候,我们可以把样式分别定义在不同的文件中,然后通过 MergedDictionaries 应用到其他资源字典中,看下面Demo
我们可以把样式定义在多个文件中,然后再App.xaml中引用
我们先定义三个文件
1、蓝色按钮资源文件,定义按钮的Foreground为Blue
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="Button"> <Setter Property="Foreground" Value="Blue"></Setter> </Style> </ResourceDictionary>