1

We are currently trying the sat assembly approach to localization of resources, but when we do this, accessing the Properties.Resources static class doesn't seem to work from XAML. Any advice or better methods for handling localization in WPF applications?

1 Answer 1

2

Delay's blog had a sample a while back about localization with wpf: This quote might help:

For readers who want a brief overview of how to use RESX-resources in WPF, here you go:

Set the Access Modifier to "Public" in the RESX designer so the auto-generated resource property accessors will be accessible to the WPF data-binding system.

Create an instance of the auto-generated RESX class (typically named "Resources") as a WPF-accessible resource:

<Window.Resources>
    <properties:Resources x:Key="Resources" xmlns:properties="clr namespace:PseudoLocalizerWPF.Properties"/>
</Window.Resources>

Create a Binding that references the relevant properties of that resource wherever you want to use them:

<TextBlock Text="{Binding Path=AlphabetLower, Source={StaticResource Resources}}"/>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - I had a similar problem and forgot to set the access modifier to Public. Here's another related article that might help people: Binding to Resources.resx for strings in a WPF Application

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.