Data-bound value not adjusted to fall into range for NumberBox
See original GitHub issueDescribe the bug
When NumberBox
has a Minimum
/Maximum
range set and the data-bound Value
does not fall within this range, one of the boundary values is displayed in the control, but the boundary value is not propagated to the view model.
Steps to reproduce the bug XAML:
<winui:NumberBox Minimum="2" Maximum="6" Value="{x:Bind Test, Mode=TwoWay}" />
C#:
public float Test {get; set;} = 0;
Now add a button that displays the value of Test
in debug output. Notice that although number box shows “2”, the output value is still 0, unless user modifies the value in any way.
Expected behavior
I would expect that the view model value would update accordingly when the “invalid” value is first bound.
Version Info
NuGet package version:
Microsoft.UI.Xaml 2.4.0
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2020 Update (19041) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Additional context
I have noticed the Slider
control behaves the same way as well.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (12 by maintainers)
Top Results From Across the Web
Java Telegram Bot: Numeric value out of range of int
Your current code is trying to convert a number to an int , which is probably defined in some jackson-annotated class in the...
Read more >dxNumberBox - DevExpress Support Center (Examples)
This example demonstrates how to allow entering only numbers in dxNumberBox. For this task we need to handle the dxNumberBox.onKeyPress event and check ......
Read more >Number Formatting | DevExpress End-User Documentation
The format does not change the value, it only changes the way the number is displayed. Number format options are available in the...
Read more >Fixes for eForm Builder
The following issues have been fixed in this release for eForm Builder. AgilePoint NX v6.0 SP1. 15.0282.26: An eForm fails to load if...
Read more >Getting Started with WinUI DataGrid control
Represents SfDataGrid column that hosts CheckBox controls to select or deselects rows which are not actually bound with data object of row. GridDateColumn ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh right, yes there a negation to much in there, you are right @StephenLPeters !
I don’t think its time critical
I think there was a mistaken double negative. @MartinZikmund go for it, looking foreword to the PR.