Hey,
I want to set up a value converter that will convert something like the string "1k" in the numeric editor to the int 1000 in the bound property.
I was curious if you have any publicly exposed value converters that I could compose? Then I could convert the string "1k" to the string "1000" and then pass the string "1000" to your value converter. This way I don't have to duplicate the actual conversion logic.
Thanks
The mask is not going to allow you to type in 1k - the entry is restricted based on the type of mask character the caret is positioned at - so I assume the information is coming that way from your underlying data - i.e. the property to which you are binding this? If so then perhaps you could just set the Converter on the Binding you are using to bind the Value of the editor to the underlying object property and perform the conversion that. With regards to your specific question about how to get to the default converter, its not public but there is a protected property that returns the default converter it will use.
Sorry for the delayed response.
In the online help for the xam numeric editor, it describes that possibility of using a custom value converter to do something like "1k" to 1000. From what you've said, do I also need to do something with the mask property so that k and m can be typed in (right now I'm using double:-10.4)?
I want to implement this custom value converter, but if possible I would like to reuse the default converter in my code. Maybe something like, getting a string from the textbox my value converter removes and stores a k or m at the end then passes the string in to the default converter, gets a number out and multiples it by 1000 if there was a k, then returns the result. If it's not easy to get to the default value converter class then I could try to duplicate what it does.
Can you give me the link to the documentation that you are referring to? I'm guessing that you're looking at the documentation on the ValueEditor - the base class of XamMaskedEditor, XamTextEditor, XamCheckEditor, etc. The XamMaskedEditor is going to restrict the characters that you can type based on the mask so its not going to allow a 'k' in a numeric mask. You could try to do something like this with the XamTextEditor but then the user can type in any characters. With regards to accessing the default value converter, the only way right now would be to derive from the editor and access its DefaultValueTo(Display)TextConverter property. By deriving from it though you're going to affect the theming since in wpf the local style is always based on the type of the class.
Here is the link:
http://help.infragistics.com/Help/NetAdvantage/WPF/2008.1/CLR3.X/html/xamEditors_Overview_of_the_ValueEditor_Class.html
I was referring to the Note in the "Custom Converters" section. Was I reading too much into it?
Hmm, I definitely don't want this to affect anything that the control does to support intuitive number editing. I just know that some users find entering something like 1.5k or 12.52m to be more convenient than typing 1500 or 12520000. I suppose something like this conflicts with a mask anyway since a decimal:-10.2 mask couldn't hold 12.52m, limiting the usefulness of this feature.
No, you weren't reading into it per se. But the usage of that implies that the editor has the text value within it. As I mentioned, the xamMaskedEditor (at least when using a numeric type mask) is not going to accept letters so it will never get to the state of having a k for the converter to convert from. I believe you could use a different mask (see the mask documentation here) that will accept non-numeric values but then you will lose the functionality that the number section offers (treating the value as a single cohesive value, moving after the decimal place when pressing the decimal separator, right aligning the values, etc.).