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
320
XamNumericEditor ignores InvalidValueBehavior
posted

Hi, I'm using XamNumericEditor in DataTemplate like this

<DataTemplate x:Key="NumericRangedTemplate" DataType="settings:RangedVisualSetting">
<!--Other parts of template-->
    <igEditors:XamNumericEditor SpinWrap="True" Margin="5" VerticalAlignment="Center" InvalidValueBehavior="DisplayErrorMessage"
                                             Width="100" Value="{Binding Value}" DisplayMode="Raw" SpinButtonDisplayMode="Always"
                                             ValueType="{x:Type system:Int32}">
    <igEditors:XamNumericEditor.PromptChar>
        <system:Char />
    </igEditors:XamNumericEditor.PromptChar>
        <igEditors:XamNumericEditor.ValueConstraint>
            <igEditors:ValueConstraint MinInclusive="{Binding MinValue, Mode=OneTime}" MaxInclusive="{Binding MaxValue, Mode=OneTime}" Nullable="False" />
        </igEditors:XamNumericEditor.ValueConstraint>
    </igEditors:XamNumericEditor>
</DataTemplate>

Both MaxValue and MinValue has type int? but in my particuar case they are not null (e.g. MaxValue == 100)

Although InvalidValueBehavior is set to "DisplayErrorMessage" I don't get it neither when I clear everything from editor (in this case red border appears around it and I can't leave it which is fine for me since ValueConstraint.Nullable is set to false. But I CAN input any value which exceeds maximum and upon leaving editor it just gets back to maximum. For some reason I see this behavior for any value of InvalidValueBehavior. How can I make it stay in edit mode and don't correct value? Library version 12.1.20121.2059.

P.S. How can I decorate code and markup properly like it is displayed in Visual Studio i.e. with different colors etc?