Proposal: Make the Tooltips of the NumberBox SpinButtons customizable
See original GitHub issueProposal: Make the Tooltips of the NumberBox SpinButtons customizable
Summary
It’s impossible right now to set tooltips for the NumberBox’s spin buttons without having to re-template the control or walk the visual tree. However, spin button tooltips would prove valuable here for developers to inform their app users what exactly will happen when they press these buttons. For example, users could learn by how much the NumberBox value will actually be increased/decreased without them having to actually press the button first and see the resulting value.
This addition to the NumberBox was also suggested by @lhak here. While they mentioned this in the NumberBox V2 collection thread I don’t think this should be treated as a NumberBox V2 feature. I actually view this is as an oversight in the design of NumberBox V1 and as such we should address this unrelated to NumberBox V2. This will not add new functionality like a “mini-calculator support” or a “calculation result preview” which logically appear to fit NumberBox V2 much better. Instead, we will enable developers with this proposal to provide a good UX for the existing NumberBox V1 without much additional work on their part.
Rationale
Enable developers to easily inform users by how much a value will be increased/decreased without requiring them to actually click on the spin buttons first.
Scope
Capability | Priority |
---|---|
Enable developers to set tooltips for the NumberBox up/down spin buttons. | Must |
API Proposal
public class NumberBox
{
public static DependencyProperty SpinButtonUpToolTipProperty { get; }
public object SpinButtonUpToolTip { get; set; }
public static DependencyProperty SpinButtonDownToolTipProperty { get; }
public object SpinButtonDownToolTip { get; set; }
}
API example
The following XAML markup
<NumberBox
SmallChange="5"
SpinButtonUpToolTip="Increase by 5"
SpinButtonDownToolTip="Decrease by 5"/>
will give us this experience:
As you can see, I set the ToolTip::PlacementMode for the down spin button to PlacementMode::Bottom when in SpinButtonPlacementMode::Compact as it would otherwise occlude the up spin button, like this:
Since both spin buttons are grouped together here, their respective tooltips should not occlude the other button.
Additional Note
I have already created these APIs in a local branch and could create a PR with these API additions as well as an API spec - if the team approves of this proposal.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top GitHub Comments
I think the problem I was referring to had to do with the SplitBox’s tooltip being in the way on the control. Not the actual customization of it. I misinterpreted the proposal. Disregard.
@MikeHillberg @SavoySchuler Friendly ping.