-
Notifications
You must be signed in to change notification settings - Fork 771
Description
Proposal: Provide lightweight styling resources for the glyphs of the NumberBox's spin buttons
Summary
Currently, the glyphs used for the spin buttons of the NumberBox
control cannot be easily changed:
Content="" |
In order to avoid having to re-template the control or walk the visual tree to change the appearance of these spin buttons, I propose the following theme resources to be added:
- NumberBoxSpinButtonUpGlyph
- NumberBoxSpinButtonDownGlyph
- NumberBoxPopupIndicatorGlyph
- NumberBoxPopupIndicatorFontSize
See the XAML markup below for an example:
<Application.Resources>
<x:String x:Key="NumberBoxSpinButtonUpGlyph"></x:String>
<x:String x:Key="NumberBoxSpinButtonDownGlyph"></x:String>
<x:String x:Key="NumberBoxPopupIndicatorGlyph"></x:String>
<x:Double x:Key="NumberBoxPopupIndicatorFontSize">17</x:Double>
</Application.Resources>
This gives us the following resulting UI:
NumberBox SpinButtonPlacementMode - Inline
NumberBox SpinButtonPlacementMode - Compact
The theme resource NumberBoxPopupIndicatorFontSize is needed here because the custom popup indicator glyph would be too small to identify comfortably with the default FontSize of 12:
Rationale
Enable developers to easily style the glyphs of the spin buttons without having to re-template the control.
Important Notes
The theme resources NumberBoxSpinButtonUpGlyph
and NumberBoxSpinButtonDownGlyph
would have to be set on the app level to take effect in SpinButtonPlacementMode::Compact as they are inside a popup control then.