是否可以创建自定义主题并将其用作默认主题?覆盖默认主题的自定义主题WP7
我可以在任何地方找到的每个示例都表示,您可以通过复制ThemeResources.xaml
和System.Windows.xaml
文件并将它们作为合并字典包含在应用程序中来创建自定义主题。
http://windowsphonegeek.com/articles/Creating-WP7-Custom-Theme-ndash-Basic-Theme-Implementation Overriding themes in Windows Phone 7
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/CustomThemeResources.xaml" />
<ResourceDictionary Source="Resources/CustomThemeStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
然后我读过多一些,你需要包括刷里面的样式文件,所以在CustomThemeStyles.xaml
我有这个。
http://www.windowsphonegeek.com/articles/Creating-WP7-Custom-Theme---Complex-Theme
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="CustomThemeResources.xaml" />
</ResourceDictionary.MergedDictionaries>
它不工作...所以我下载示例应用程序,果然,每一个希望有一些变色,像背景颜色页面,将其设置在它的最外面的组件。
<Grid Background="{StaticResource PhoneBackgroundBrush}">
...
</Grid>
是否有可能包括改变风格/刷子/颜色的自定义主题的/ etc所有默认设置,而无需显式地设置他们无处不在?
我有一个我希望随时应用的风格/主题,无论它是光线还是黑暗的主题。是通过复制'ThemeResources.xaml'文件并更改所有内容的最好方法,然后明确设置不像背景那样设置的东西?还是有很多东西不会通过使用合并主题隐式设置? – 2011-04-14 15:19:30