Establish WPF Custom User Culture

I wrote a user control that is not compatible with cultures other than "en-US". It is also inevitable to embed this user control in an application with a culture that is not "en-US". So is it possible to make an application not to change this user control culture?
It is preferable to have a solution inside a user control.
I read this topic: Localizing a WinForms application with WPF built-in user controls but I can’t use WpfLocalization.LocalizationScope.SetCulture Does
this function really exist?

There is also a Localized tag that can be set to False , but it's easy to identify resources in .csproj files : http://msdn.microsoft.com/en-us/library/ms788718.aspx

So is there anyone who has an idea about this problem?


Additional clarification:
 Suppose we have an application with culture X and a user control compatible with the culture "en-US". This user control has a dependency property that is of type DateTime and gets its value this way:
<my:uc1 x:Name="UserControl1" Date="4234/12/22" />

When the application culture is "en-US", the user control will receive "4234/12/22" , but when the application culture is something else, it will convert "4234/12/22" automatically to the application’s own calendar and deliver "0744 / 04/08 " to the user control and destroys every user control logic! This is a catastrophe.

I want to prevent this conversion by setting the user management culture exclusively to "en-US".

Hope I clarified the situation enough.

+3
source share
1 answer

FrameworkElement.Language xml:lang XAML . , , - en-US.

, /, , , . . DateTime, D ( ), - Monday, 30 April 2012, xml:lang="en-US" 30. april 2012, xml:lang="da-DK".

, XAML, ,

<my:uc1 x:Name="UserControl1" Date="4/30/2012" />

CultureInfo.InvariantCulture ( en-US). , , , . , , 30/4/2012 , . , Visual Studio en-US, da-DK ( d/M/yyyy).

+4

All Articles