First-class support for custom themes #110
Labels
API suggestion
Early API idea and discussion, it is NOT ready for implementation
Enhancement Requested
Product code improvement that does NOT require public API changes/additions
Milestone
It is currently not possible to use a custom theme as a drop-in replacement for a system theme. While it is possible to style everything, it requires more cumbersome work that is easily missed.
For example:
UserControl
) always require an explicitBasedOn="{StaticResource {x:Type ...}}"
or else they are based on the system theme.ListView
without aGridView
uses theListBox
style, but providing a custom one is not enough, it has to be explicitly set on theListView
.ContextMenu
does not style the built-in one of textboxes or scrollbars. A prominent example where this can be seen is Visual Studio:My high-quality Aero themes for WPF use reflection and method hooking to solve these problems (But that's just a brittle hack. In fact, it breaks on .NET Core because tiered compilation makes hooking more difficult.). It does so by replacing
System.Windows.SystemResources.FindDictionaryResource
, normally responsible for locating the theme resource assembly and style for a given type or resource key, with one that can load custom resource dictionaries.So my wish would be for adoption of a public API to set policies for resource loading, at least for
PresentationFramework.dll
.The text was updated successfully, but these errors were encountered: