Hi,
I want to display a TimeSpan value in a XamMaskedEditor. I have the following XAML:
<igEditors:XamMaskedEditor ValueType="{x:Type System:TimeSpan}" Mask="##:##" Value="{Binding Path=MyTimeSpanValue}"> <igEditors:XamMaskedEditor.ValueToTextConverter> <local:TimeSpanToTextConverter /> </igEditors:XamMaskedEditor.ValueToTextConverter> <igEditors:XamMaskedEditor.ValueToDisplayTextConverter> <local:TimeSpanToTextConverter /> </igEditors:XamMaskedEditor.ValueToDisplayTextConverter></igEditors:XamMaskedEditor>
My Convert method looks like this:
TimeSpan ts = (TimeSpan)value; string result = ts.Hours.ToString().PadLeft(2, '0') + ":" + ts.Minutes.ToString().PadLeft(2, '0'); return result;}
Whenever Convert is called, the result is as expected. The result for a TimeSpan object with Hours set to 1 and minutes set to 5 will be "01:05"
Still, this is not working in the XamMaskedEditor -- it will just display the literal : from the mask.
I'm probably missing something..