zz - reprint and synthesized Themes, Style and Skins

本文探讨了WPF中主题和皮肤的概念及其应用场景。主题是一组由控件作者定义的资源,通常与窗口主题设置相关联;而皮肤则是在应用程序级别设置的一组资源,用于改变控件外观而不影响窗口主题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 ComboBoxTextBoxButtons, 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.

"





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值