1

我想在我的项目中使用PL,现在我坚持本地化。我将我的资源和LocalizedStrings移至PL项目。我LocalizedStrings是这样的:便携式库中的本地化

namespace Activity.Localization 
{ 
    public class LocalizedStrings : INotifyPropertyChanged 
    { 
    public LocalizedStrings() 
    { 
    } 

    private static Resources.AppResources localizedResources = new Resources.AppResources(); 

    public Resources.AppResources LocalizedResources { get { return localizedResources; } } 

    public void ResetResources() 
    { 
     OnPropertyChanged("LocalizedResources"); 
    } 

    public event PropertyChangedEventHandler PropertyChanged; 

    protected void OnPropertyChanged(string name) 
    { 
     var handler = PropertyChanged; 
     if (handler != null) 
     { 
      handler(this, new PropertyChangedEventArgs(name)); 
     } 
    } 
    } 
} 

和资源的资源文件夹(这是自动生成从Windows手机项目)。

现在在我看来,我有这样的按钮(Windows Phone的项目,MainPage.xaml中):

<controls:MenuButton x:Name="btnStartGame" 
          Text="{Binding Path=LocalizedResources.btnStartGame, Source={StaticResource localization:LocalizedStrings}}" 
          Tap="btnStartGame_Click" 
          Height="80" Width="400" 
          FontSize="30" Margin="12"/> 

它编译和构建,但是当应用程序启动,我得到异常:

Cannot find a Resource with the Name/Key localization:LocalizedStrings 

所以我认为我必须做一些改变才能使本地化到可移植的库,但哪一个?我怎样才能改变它,让它工作?由于

回答