turtlepower
turtlepower

Reputation: 379

Windows Phone 7 Hiding the Application Bar

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

menubar.IsVisible = false;

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?

Upvotes: 11

Views: 5124

Answers (4)

Mick N
Mick N

Reputation: 14882

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

ApplicationBar.IsVisible = true/false;

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

Why are the ApplicationBar objects not FrameworkElements? - Peter Torr's Blog

Upvotes: 23

Rev
Rev

Reputation: 33

ApplicationBar.IsVisible = false;

Upvotes: 0

Phil
Phil

Reputation: 636

To do it in code behind if you have not referenced it other than in XAML:

(ApplicationBar as ApplicationBar).IsVisible = true;

Upvotes: 1

turtlepower
turtlepower

Reputation: 379

Nevermind, I found it. You can't call the name you've given it, have to use applicationbar.isivisble = false

Upvotes: 5

Related Questions