每当我创建新的 WPF 应用程序或 WPF 用户控件库时,AssemblyInfo.cs
文件包含以下属性:
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
//where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly
//where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
这是什么ThemeInfo
属性为?如果我删除它,我会破坏任何东西吗?
ThemeInfo 属性指定自动主题机制应在何处查找主题字典和通用字典。每个选项都可以设置为以下值之一:
- None(默认):不查找资源字典。
- SourceAssembly:字典是当前程序集。
- ExternalAssembly:字典位于不同的程序集中,必须命名
<AssemblyName>.<ThemeName>.dll
, where <AssemblyName>
是当前程序集的
姓名。
如果主题字典为外部程序集中定义的控件指定样式,例如,WPF 控件System.Windows.Controls.ProgressBar
and System.Windows.Button
,那么你必须使用ThemeDictionaryExtension
将应用程序指定为主题词典的源。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)