I want to bind a property object to a textBox, but the value is devided to 100 the filled in object, I have:
<TextBox Text="{Binding P1}" />
and in my code:
this.DataContext = MyObj; //MyObj has P1 property.
I want in submitting my form instead of textBox Text, the text that is a number is devided to 100 and filled in MyObj. fro example if user enterd 200 in text box, 2 is pushed in my object
You would need to define and use a
Converterfor passing the value to the object property from the textbox. The converter should first divide the value passed to it from the textbox by 100 and then return the value. For more information on how to use converters please refer below link:http://www.wpftutorial.net/ValueConverters.html
http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx