question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data-bound value not adjusted to fall into range for NumberBox

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
chingucodingcommented, Jul 30, 2020

Oh right, yes there a negation to much in there, you are right @StephenLPeters !

1reaction
StephenLPeterscommented, Jul 30, 2020

Right, yes. I don’t think it’s not that time critical. If you need help with setting up the repro or getting started, feel free to ask!

I don’t think its time critical

I think there was a mistaken double negative. @MartinZikmund go for it, looking foreword to the PR.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found