1
我想創建一個本地化的Windows Phone 8應用程序,並且我正在創建一個全局應用程序欄。然而,我無法使用資源設置欄內的項目文本,任何人都有一個想法如何做到這一點?我也無法在代碼中獲得它。Windows Phone 8全球應用程序酒吧本地化
我想創建一個本地化的Windows Phone 8應用程序,並且我正在創建一個全局應用程序欄。然而,我無法使用資源設置欄內的項目文本,任何人都有一個想法如何做到這一點?我也無法在代碼中獲得它。Windows Phone 8全球應用程序酒吧本地化
您可以重複使用的模板的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控件,所以你必須在每一頁編程方式創建,如果你想它本地化。