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
960
XamNumericInput Binding Not updates property
posted

I'm starting to think that I'm writing strange programs, because what I do and I consider very simple in MVVM context does not work as I expect.

I suppose  I'm doing things wrong and I hope you can enlight me.

I have a Window, that edits a Class with 2 properties Name, Weight, Name is a string so I use a Textbox editor and works perfectly Weight is an integer so I've set a XamNumericInput editor the code for the two controls is as follows:

<TextBox Grid.Row="0" Grid.Column="1" Margin="4,20,4,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Text="{Binding Path=Item.Name, Mode=TwoWay}" />

<ig:XamNumericInput Grid.Row="1" Grid.Column="1" Margin="4,20,4,20"
 HorizontalAlignment="Stretch"
 VerticalAlignment="Center"
 Value="{Binding Path=Item.Weight, Mode=TwoWay}"
 Mask="nnnnnn" InvalidValueBehavior="DisplayErrorMessage"/>

Now while the Textbox works perfectly and is set with the value when I initialize the Item Property and Updates its value when the Text is changed

The XamNumericInput unfortunately displays the right value so I presume the binding is at last working one way but it does not change the value property when edited I've tried also not using a Mask and the control puts a non integer

In all the samples you made in your sample browser the only bindings made on XamNumericInput are made on properties that are of no use (Mask or other settings nice to know I can bind them but maybe something more regarding Value binding?)

The Only sample with a binding to the value, binds a textblock to the value using the elementname inside xaml, no samples with a viewmodel...

can you tell me what do I have to do to use a bound property to this editor

thank you in advance

regards

Sabrina