Skip to content

Expose facilities for contributing to/controlling the WPF Themeing engine #1913

Open
@DigitlWorld

Description

@DigitlWorld

The themeing engine that WPF uses to apply Default Styles to all elements should be made available for application specific override/replacement rather than being locked to the 6 or so PresentationFramework.*.dll themes. Instead of relying on a fixed set of system themes (e.g. Aero, Luna, etc.) and related sub-themes (e.g. Luna.Metallic), partially forced by System settings and events, I suggest opening up this mechanism to allow application designers to fully control the actual default styles for their application.

The problem is that not being able to easily create/set default styles via themeing causes a great deal of downstream headaches for developers and designers when attempting to devise an entire replacement skin for an application:

  • You can't replace the Default Style of a control. As a result, any use of Styles in local application code causes the style to be reverted to Default + Local Style. While BasedOn does allow for Style inheritance, this relies on downstream users of a theme to be intimately familiar with how the theme resources are constructed and laid out.
  • There are potential workarounds that involve Reflection and hooking the Windows Message loop (e.g. http://northhorizon.net/2010/how-to-actually-change-the-system-theme-in-wpf) but that is fragile code that is subject to breaking if any part of that mechanism breaks down.

If it's already possible to do what I'm suggesting, then consider this a documentation improvement request, as it isn't clear at all from the documentation as to how one would go about replacing the actual default styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design DiscussionOngoing discussion about design without consensusEnhancement RequestedProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions