简体   繁体   English

如何在wp7中本地化应用程序栏?

[英]how to localize a application bar in wp7?

is it possible to localize the application bar? 是否可以本地化应用程序栏?

i made the tutorial on msdn how to localize a application and everything was find. 我在msdn上制作了如何本地化应用程序的教程,一切都找到了。 but the method with: 但方法有:

{Binding Localizedresources.Today, Mode=OneWay}

dont work on the app. 不要在应用程序上工作。 bar 酒吧

what can i do? 我能做什么?

If you don't want to use a 3rd party solution like James Cadd suggested, you may create the application bar from your code-behind and using your resources to fill-in the Text-property: 如果您不想使用像James Cadd建议的第三方解决方案,您可以从代码隐藏创建应用程序栏并使用您的资源填写Text-property:

public MainPage() {
  InitializeComponent();
  Loaded += MainPage_Loaded;
}

void MainPage_Loaded(object sender, RoutedEventArgs e) {
  BuildApplicationBar();
}

private void BuildApplicationBar() {
  ApplicationBar = new ApplicationBar();

  var appBarButtonAdd = new ApplicationBarIconButton(new Uri("/img/add.png", UriKind.Relative)) { Text = AppResources.ABAdd };
  appBarButtonAdd.Click += newEntry_Click;
  ApplicationBar.Buttons.Add(appBarButtonAdd);

  var appBarMenuReview = new ApplicationBarMenuItem(AppResources.ABMarketplace);
  appBarMenuReview.Click += review_Click;
  ApplicationBar.MenuItems.Add(appBarMenuReview);
}

You haven't included much to work with, but I wrote a pretty good (I think) blog on the subject, including code from start to finish on localizing an app. 你没有多少工作,但我写了一篇关于这个主题的非常好的(我认为)博客 ,包括从本地化应用程序开始到结束的代码。 It covers localization from start to finish, with screenshots and downloadable code, including the application bar. 它涵盖了从开始到结束的本地化,屏幕截图和可下载的代码,包括应用程序栏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM