This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, If I have an "object" property which I set to a double value and bind it to the NumericTextBox the binding does not work properly. The value is not shown and is not updated when it is changed in the UI. Even though the type shows it is a double. (see pseudo code below) Will you be able to provide a version which supports this type of binding? Thank you Oscar PSEUDO CODE: double value = 55.55; public VmMainWindow() { myValue = value ; Type type = myValue.GetType(); } private object myValue; public object MyValue { get { return myValue; set { Set(ref myValue, value, "MyValue"); } } XAML PART: |
|
|
Hello Oscar Thanks for getting in touch. The reason this does not work is because the NumericTextBox functions on decimal values, not doubles. Setting MyValue to be a double causes the binding to fail. You can resolve this either casting the value to a decimal before setting the MyValue property, or use a decimal value instead of a double, or you could use our DoubleTextBox control. (If you don't have the DoubleTextBox control and wish to use it, make sure to update to the latest nightly build). -Jason Fauchelle |
|
|
Thanks Jason, I used the DoubleTextBox and it worked. What threw me was that when I looked at your samples it used the NumericTextBox for an example labelled "Double" . Oscar |
|
|
Hello Oscar Great to hear you got it working. Sorry for the confusion with the demo, I've now changed the label. -Jason Fauchelle |
|