Windows Phone 7 Hiding the Application Bar

前端 未结 4 1653
温柔的废话
温柔的废话 2021-02-20 04:38

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 refe

相关标签:
4条回答
  • 2021-02-20 04:54

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

    0 讨论(0)
  • 2021-02-20 05:01

    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

    0 讨论(0)
  • 2021-02-20 05:04

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

    (ApplicationBar as ApplicationBar).IsVisible = true;
    
    0 讨论(0)
  • 2021-02-20 05:05

    ApplicationBar.IsVisible = false;

    0 讨论(0)
提交回复
热议问题