How do I localize a WPF application so that the left-side rights are displayed correctly?

What steps are required to localize a WPF application so that left-side rights are displayed correctly?

+2


source to share


1 answer


I understand his old question, but I'm stuck with this, so I add what I did (which works partially) in the hopes that someone will add more to it

In your app.cs app you can do something like this



    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);

        FrameworkElement.LanguageProperty.OverrideMetadata(
          typeof(FrameworkElement),
          new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

        FrameworkElement.FlowDirectionProperty.OverrideMetadata(
        typeof(FrameworkElement),
        new FrameworkPropertyMetadata(CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft
                                      ? FlowDirection.RightToLeft : FlowDirection.LeftToRight));

    }

      

Now this resets everything ok, but it also happens to flip all the images you don't need.

+2


source







All Articles