Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First-class support for custom themes #110

Open
gix opened this issue Dec 6, 2018 · 1 comment
Open

First-class support for custom themes #110

gix opened this issue Dec 6, 2018 · 1 comment
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

Comments

@gix
Copy link

gix commented Dec 6, 2018

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:

  • Custom styles outside of the custom theme (e.g. local styles in a UserControl) always require an explicit BasedOn="{StaticResource {x:Type ...}}" or else they are based on the system theme.
  • Inheritance does not work. Normally ListView without a GridView uses the ListBox style, but providing a custom one is not enough, it has to be explicitly set on the ListView.
  • Providing a style for ContextMenu does not style the built-in one of textboxes or scrollbars. A prominent example where this can be seen is Visual Studio:
    wpf1

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.

@rladuca rladuca added 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 labels Dec 6, 2018
@rladuca rladuca added this to the Future milestone Dec 6, 2018
@Poopooracoocoo
Copy link

It makes me sad that this is more than a year old. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants