Bayern
Bayern

Reputation: 350

Hiding the status bar on all pages in a Windows Phone 8.1 App

I can hide the status bar on each page but is there an easier way to do this in one place?

Upvotes: 0

Views: 508

Answers (2)

zavolokas
zavolokas

Reputation: 707

You can hide it in the App.xaml.cs in the OnLaunched event handler. In order to avoid adding async to the OnLaunched method, you can use Wait() method of Task:

StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

// Hide the status bar
Task hidingStatusBarTask = statusBar.HideAsync();
hidingStatusBarTask.Wait();

Upvotes: 1

Dimitris Batsougiannis
Dimitris Batsougiannis

Reputation: 759

Go in you App.xaml.cs file and in the OnLaunched add this

StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();

// Hide the status bar
await statusBar.HideAsync();

Upvotes: 2

Related Questions