Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
XamNumericInput.Value does not honour constraint
posted

Hi Infragistics,

The documentation states that the Value property will only be updated if the value entered is valid.

Let's say we have a ValueConstraint as follows (in a style)...

<Setter Property="ValueConstraint">

    <Setter.Value>

        <ig:ValueConstraint ValidateAsType="Integer32" MinInclusive="10" MaxInclusive="1000"/>

    </Setter.Value>

</Setter>

If we type an invalid value (e.g. 5) the Value property is updated, even if the InvalidValueBehavior is RevertValue.

We're using MVVM and binding, so this scenario updates the model with the invalid value, which causes all sorts of issues.

If these controls are to be used for binding in WPF (e.g. MVVM) then the Value property must only be updated if it passes the ValueConstraint.