Whenever I create a new WPF application or WPF user control library, the AssemblyInfo.cs
file includes the following attribute:
[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)
)]
What is this ThemeInfo
attribute for? Will I break anything if I remove it?
ThemeInfo attribute specifies where the automatic theming mechanism should look for the theme dictionaries and the generic dictionary. Each option can be set to one of the following values:
<AssemblyName>.<ThemeName>.dll
, where <AssemblyName>
is the current assembly's
name.If the theme dictionaries specify styles for controls that are defined in external assemblies, for example, the WPF controls such as System.Windows.Controls.ProgressBar
and System.Windows.Button
, then you must use the ThemeDictionaryExtension
to specify the application as the source for the theme dictionaries.