themes/..xaml
themes/luna.normalcolor.xaml
themes/luna.homestead.xaml
themes/luna.metallic.xaml
themes/royale.normalcolor.xaml
themes/aero.normalcolor.xaml
themes/Classic.xaml
Also include a generic.xaml file which is the fallback style
The next step is to include an assembly attribute
[assembly:ThemeInfo(ResourceDictionaryLocation.SourceAssembly, ResourceDictionaryLocation.SourceAssembly)]
The first parameter tell the theme engine to look for the theme ResourceDictionary in the current assembly. The second parameter specifies that there is a generic.xaml file which can be used as a fallback. Compile and Run. Change the themes to see it working :)
There is an attached zipped file which shows the same for a custom button :) which functions more like a label ;) .. looks something like the below ..
本文介绍如何为自定义UI控件实现主题依赖的设计方法,包括文件组织结构、样式定义及回退机制等内容。

被折叠的 条评论
为什么被折叠?



