Hello,
I am working a job that has me authoring controls, which is interesting; however, an over-arching design goal is to want to capture and apply potentially cross-cutting themes in a more or less (more, is preferred) reusable manner.
I am interested in a little feedback. I want to know the best possible way working with WPF to expose cross-cutting style and/or thematic framework elements to custom controls.
For C# language reasons, our base classes extend from things like Button, ToggleButton, etc, in order to apply "flat" styling to them. There are more complex controls which simply inherit from UserControl in order to do layout, composition, etc.
One approach I am considering is extending the "FrameworkElement" as a dependency property in the base class(es), or possibly "UIElement", etc, for purposes of exposing common items, such as SmallFontSize, MediumFontSize, or LargeFontSize.
Things like a set of Brush properties are also cross-cutting concerns. Such that the element(s) expose the customization, and land in the classes as DependencyProperties themselves: goal being, minimal amount of duplicate effort where customization is concerned.
I mentioned libraries like Telerik are "virtually there" where this kind of thing is concerned, but the insistence was to rolling-our-own.
Feedback appreciated.
Thank ye...
Regards.