简体   繁体   中英

How to add an application bar to a user control in wp7

I have built a wizard style user control that lets you add stackpanel based pages and flick between them.

I would like to add an application bar as part of the user control with next and previous buttons that enable/disable based on page displayed etc.

Application bar appears to be an attached property of PhoneApplicationPage. I have tried referencing Microsoft.Phone.Shell but get invalid type.

Any ideas how I can add it to my user control?

Application bar is such a pain in the a**. This control is not a Silverlight one but a native one. Maybe you can be more lucky with this solution: http://blog.humann.info/post/2010/08/27/How-to-have-binding-on-the-ApplicationBar.aspx

The ApplicationBar is a service that is provided by the operating system, ie not part of the Framework, and can only be used at the page-level, not in your UserControl . In addition, the ApplicationBar does not support regular bindings as you've seen. As mentioned above there are a number of solutions that provide workarounds for this problem.

Alternatively, you could use the ApplicationBarButtonCommand and ApplicationBarButtonNavigation behaviors from the Silverlight Windows Phone Toolkit . It's a simple enough task to create your ApplicationBarMenuCommand if you need one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM