パノラマ ビューのコード ビハインドでローカライズされたアプリケーション バーを作成しようとしています。これが私のコードです:
// 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);
}
ただし、ApplicationBar をプロパティとして認識しません。エラーには、「Microsoft.Phone.Shell.ApplicationBar」は「タイプ」ですが、「変数」として使用されています。理由はありますか?どうもありがとう!
フェイ