This blog is the synthesized based on the following articles. What exactly does FrameworkElement.DefaultStyleKeyProperpty.OverrideMetadata do? and WPF Themes and SKins Engines.
So what are they and on which occasion to choose which?
so in high level . 'Themes are set of resources that are defined by control author, should be defined under a folder named "Themes", have specific names, and change based on windows theme setting. Skins are set of resources that are typically set at the Application level and can be used to change the look of controls while the windows theme remains the same. Themes are tightly bound to the controls and can be changed only by the control author. Skins can be applied to any control including controls you dont have source code for."
and from WPF Themes and SKins Engines. it has the following declarations in regards to the difference between Themes/Skins...
"
Skin
Set of UI visual Resources and Styles that usually can be replaced at runtime by the user. Skins can be installed with the application, or can be downloaded later from the internet. Skins change the face of the user interface, shapes, colors, backgrounds etc. If well designed, a skin can be created and/or edited by users. See applications such as Media Player, WinAmp and many others.
Theme
Windows operating system based theme. The one you replace from the Display/Desktop setting. For example: Classic, Luna, Royale, Aero, etc. WPF has a built-in mechanism for loading styles based on the actual Windows theme (seethis). Most developers mislead by saying Theme but intended to say Skin. Themes change the face of Windows controls, such as ComboBox, TextBox, Buttons, etc. Themes are replaced from the Windows settings and not from the Application settings.
This article is not dealing with the creation of Windows themes. It only shows how to load them at runtime as skins, without depending on Windows settings.
"
本文探讨了WPF中主题和皮肤的概念及其应用场景。主题是一组由控件作者定义的资源,通常与窗口主题设置相关联;而皮肤则是在应用程序级别设置的一组资源,用于改变控件外观而不影响窗口主题。
2216

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



