-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Default Control Themes #1883
Comments
How the magic of generic.xaml works for WPF (from stackoverflow.com)
|
how about a StyleIgnoreInclude option in App.xaml or some other mechanism to ignore or prevent loading the default for advanced uses. |
Looks like the WPF implementation does a lot in the process of resolving a resource. |
Currently when a third-party control is used, the user needs to install a style with a theme for the
control into
App.xaml
otherwise when the control is used nothing will appear. This is obviously notideal.
The obvious way around this would be to automatically install a default theme style into
App.xaml
the first time a control was used, but this has some problems:
load time
applied to the control even though from the users point of view the style hasn't been installed[1]
In WPF/UWP the generic theme isn't added to App.xaml, it's "magically" applied if no theme for
the control is found. I suspect this is done for these reasons.
A Potential Solution
I'd like to put forward a solution for this:
[DefaultTheme(url)]
attribute can be applied to controls to point to the default themeStyle
:IsTheme
a theme style should probably not allow class selectors etc.
style referenced by the
[DefaultTheme]
attribute is appliedThoughts?
[1]: Say the automatically installed theme contains a setter for
Foreground
but the user's themedoesn't. This
Foreground
setter would be applied to the control even though the user doesn't wantit.
The text was updated successfully, but these errors were encountered: