K
Kirill
Hello,
There is a good chance that there is a better group to post this question,
but unfortunately I failed to find one. Any points in the right direction
will be greatly appreciated.
The question concerns localization of date, time and number formats in WPF
windows.
Here is what I want:
a WPF window with a text field, bound to a DateTime DependencyProperty,
formatted according to easily configurable property.
Here is what I found:
- such field is NOT formatted according to CultureInfo.CurrentCulture (which
is set at the very beginning of the application, even before any windows are
created, with Thread.Culture.CurrentCulture = ...);
- such field is NOT formatted according to CultureInfo.CurrentUICulture (set
in a similar way);
- such field is formatted according to the Language property of the window.
However, the Language property needs to be set on each window individually,
which causes a lot of headaches in my code (there are quite few windows
already).
The question:
Is there any way to force the formatting of date-, time- and numbers-bound
text fields in WPF?
Thank you for any help and ideas!
Kirill.
There is a good chance that there is a better group to post this question,
but unfortunately I failed to find one. Any points in the right direction
will be greatly appreciated.
The question concerns localization of date, time and number formats in WPF
windows.
Here is what I want:
a WPF window with a text field, bound to a DateTime DependencyProperty,
formatted according to easily configurable property.
Here is what I found:
- such field is NOT formatted according to CultureInfo.CurrentCulture (which
is set at the very beginning of the application, even before any windows are
created, with Thread.Culture.CurrentCulture = ...);
- such field is NOT formatted according to CultureInfo.CurrentUICulture (set
in a similar way);
- such field is formatted according to the Language property of the window.
However, the Language property needs to be set on each window individually,
which causes a lot of headaches in my code (there are quite few windows
already).
The question:
Is there any way to force the formatting of date-, time- and numbers-bound
text fields in WPF?
Thank you for any help and ideas!
Kirill.