2013-04-22 117 views

回答

1

您可以重复使用的模板的MainPage.xaml.cs中注释代码:

private void BuildLocalizedApplicationBar() 
{ 
    // Set the page's ApplicationBar to a new instance of ApplicationBar. 
    ApplicationBar = new ApplicationBar(); 

    // Create a new button and set the text value to the localized string from AppResources. 
ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative)); 
//Search in AppResources.Search is a key of a string in the resource files (.resx) 
appBarButton.Text = AppResources.Search; 
ApplicationBar.Buttons.Add(appBarButton); 

// Create a new menu item with the localized string from AppResources. 
//Search in AppResources.Search is a key of a string in the resource files (.resx) 
ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.Search); 
ApplicationBar.MenuItems.Add(appBarMenuItem); 
} 

不幸的是,应用栏是不是一个传统的Silverlight控件,所以你必须在每一页编程方式创建,如果你想它本地化。

相关问题