
Using the old DateTimePicker, I made a custom converter (for the ValueConverter property) so that I could display some extra calcualte information in the fields (for instance, the number of months since today).
What would be the best way to do this in the DateTimeEditBox? I originally thought that I would add a custom part to it and style it to be read only or somthing - but that looked like an aweful lot of work.
What seemed like a vastly easier way is to dynamically construct the Format property, and set it to something like "MM/dd/yyyy (12 \M\o\n\t\h\s)". This works perfectly, except for one problem - whenever the Format property changes, the control resets the focus to the first part of the control, which is really annoying (I trap the value changed event and calculate the format there). I tried to make it so that, if the control has focus, then I ignore the value change event - however, when moving between parts (which seems to be when the value is updated), IsFocused return false.
I'm really hoping that there is an easy way to do what I'm trying to do - needing to figure out how to build a custom part just for some dynamic display-only information is unfortunate.
David Mullin
What would be the best way to do this in the DateTimeEditBox? I originally thought that I would add a custom part to it and style it to be read only or somthing - but that looked like an aweful lot of work.
What seemed like a vastly easier way is to dynamically construct the Format property, and set it to something like "MM/dd/yyyy (12 \M\o\n\t\h\s)". This works perfectly, except for one problem - whenever the Format property changes, the control resets the focus to the first part of the control, which is really annoying (I trap the value changed event and calculate the format there). I tried to make it so that, if the control has focus, then I ignore the value change event - however, when moving between parts (which seems to be when the value is updated), IsFocused return false.
I'm really hoping that there is an easy way to do what I'm trying to do - needing to figure out how to build a custom part just for some dynamic display-only information is unfortunate.
David Mullin