Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation buttons hiding Windows Phone 8.1

I'm building a Windows Phone 8.1 application, and I'm facing the following problem. There are phones that don't have hardware navigation buttons(those for back, home and search). Those phones will shrink whole UI when virtual navigation bar appears, I don't want that to happen. So what can I do to prevent this? Internet seams not to know the answer(or I haven't searched good enough). This is what I mean when I say virtual navigation buttons.

enter image description here

like image 531
Aleksandar Cvetić Avatar asked Sep 28 '15 12:09

Aleksandar Cvetić


1 Answers

You need to set the ApplicationViewBoundsMode to UseCoreWindow:

 ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

The default is ApplicationViewBoundsMode.UseVisible which is your current behavior. With ApplicationViewBoundsMode.UseCoreWindow, the command bar, status bar nor the software buttons will occupy space.

If you need to change your margins or anything else when the BoundsMode changes, register for the VisibleBoundsChanged event:

ApplicationView.GetForCurrentView().VisibleBoundsChanged += OnVisibleBoundsChanged

You can read more in the official documentation.

like image 137
Kristian Vukusic Avatar answered Nov 13 '22 10:11

Kristian Vukusic