1

このチュートリアルの手順に従って、WindowsPhoneアプリのローカライズをステップバイステップで実行しました

ただし、何らかの理由で、Text = "{Binding Path = AppResources.Title、Source ={StaticResourceLocalizedStrings}}"が機能しません。エラーなどは発生しません。

ただの空の箱です。

何が間違っているのでしょうか?

4

1 に答える 1

7

I have localised my app the following way

  1. Have a class named LocalizedStrings with the an instance of it created

    public class LocalizedStrings
    {
       public LocalizedStrings()
       {
       }
       private static AppName.AppResources localizedResources = new AppName.AppResources();
    
       public AppName.AppResources LocalizedResources
       {
        get
        {
            return localizedResources;
        }
       }            
    
    }
    
  2. Add the necessary Resx files (eg AppResources.de.resx ) with the localized strings

  3. Add the following in App.xaml inside the Application.Resources tag.

    <local:LocalizedStrings xmlns:local="clr-namespace:AppName" x:Key="LocalizedStrings"/>

And finally add the supported culture in the csproj file.

Then bind the xaml element like this

Text="{Binding Path=LocalizedResources.pivotItemTitleCalendar, Source={StaticResource LocalizedStrings}}" 

One important thing that we forget most often is to change the acces modifier to Pulic. Open your AppResources.resx, you can see a field called Access Modifier. Change the value from internal to Public.

于 2013-02-06T11:25:28.723 に答える