Windows Phone 7 隐藏应用程序栏 [英] Windows Phone 7 Hiding the Application Bar

查看:31
本文介绍了Windows Phone 7 隐藏应用程序栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够按下一个按钮来禁用我的应用程序中的菜单栏.如果你去

I would like to be able to press a button to disable the menu bar in my application. If you go

menubar.IsVisible = false;

它抛出一个空引用异常.菜单栏在 XAML 中声明.

it throws a null reference exception. The menu bar is declared in XAML.

有谁知道是否可以像这样即时隐藏它?

Anyone know if its possible to hide it on the fly like this?

推荐答案

您可以作为 ApplicationBar 上的静态成员访问它.即

You can access this as a static member on ApplicationBar. i.e.

ApplicationBar.IsVisible = true/false;

这里有一些关于为什么 ApplicationBar 不像普通的 Silverlight 元素那样播放的背景.

Some background here on why ApplicationBar doesn't play like normal silverlight elements.

为什么 ApplicationBar 对象不是 FrameworkElements?- 彼得托尔的博客

这篇关于Windows Phone 7 隐藏应用程序栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆