I m trying to make a localized application bar in panorama view s code behind. Here s my code:
// Helper function to build a localized ApplicationBar
private void BuildApplicationBar()
{
// Set the page s ApplicationBar to a new instance of ApplicationBar.
ApplicationBar = new ApplicationBar();
ApplicationBar.Mode = ApplicationBarMode.Minimized;
// Create a new button and set the text value to the localized string from AppResources.
ApplicationBarIconButton homeButton = new ApplicationBarIconButton(new Uri("/Images/icons_home.png", UriKind.Relative));
homeButton.Text = AppResources.HomeIcon;
ApplicationBar.Buttons.Add(homeButton);
homeButton.Click += new EventHandler(HomeButton_Click);
ApplicationBarIconButton searchButton = new ApplicationBarIconButton(new Uri("/Images/appbar.feature.search.rest.png", UriKind.Relative));
searchButton.Text = AppResources.SearchIcon;
ApplicationBar.Buttons.Add(searchButton);
searchButton.Click += new EventHandler(SearchButton_Click);
}
然而,它不承认我的申请Bar是一种财产。 错误说:Microsoft.Phone.Shell.Application 律师协会是一种类型,但被用作一种变量。 任何想法为什么? 非常感谢!
Fei