Question

I want to give the user the option to change language so I created two resource files, one for Portuguese and another for English (US).

For the name field I'm giving it names like String1, String2, String3, etc... And in the value field I'm writing the names of my buttons, for PT and EN.

I'm using the following code in my xaml file to bind the strings to my buttons:

<Button Content="{Binding Resources.String5, Source={StaticResource Strings}}" BorderThickness="0" VerticalContentAlignment="Bottom" FontSize="29.333">
                <Button.Background>
                    <ImageBrush Stretch="Uniform" ImageSource="images/Warning-icon.png"/>
                </Button.Background>
</Button>

The problem is in String5. It doesn't show up. It works great for String1 to String4, but after that it doesn't show anymore strings.

Image: http://snag.gy/PLcET.jpg

Is there any string limit for a resource file?

Était-ce utile?

La solution

Solved. Besides the PT and EN resource files I also have a String resource file. That is the original file that I created. PT and EN files are a copy of it with the respective culture code (pt-PT and en-US). I had to add String5 in that file as well.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top