English 中文(简体)
申请 律师协会是一种类型,但在《全貌》观点中被用作一种变量。
原标题:ApplicationBar is a type but is used as a variable in Panorama view

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

问题回答

您的称谓与原样。 改名。 因此:

ApplicationBar ApplicationBar
{
  get;
  set;
}

页: 1

ApplicationBar MyApplicationBar
{
  get;
  set;
}

以及

ApplicationBar = new ApplicationBar();

页: 1

this.MyApplicationBar = new ApplicationBar();

以及 any other reference 页: 1 the propriety 页: 1 this.MyApplicationBar





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签