Windows Phone 8.1 and Windows Runtime Apps How to #4 – How to Hide Status Bar in Windows Phone 8.1 XAML App ?

In Windows Phone 8.0 , the developer could use the SystemTray.IsVisible property to hide or show the System Tray / Status bar . When the developers target the Windows Phone Silverlight 8.1 , they could still use the SystemTray.IsVisible and set this value to false to hide the status bar. But what if the developer targets Windows runtime app ?

How to Hide Status Bar in Windows Phone 8.1 XAML / Windows Runtime App

?

If you are a developer targeting the Windows Phone 8.1 & Windows runtime or even the Universal App , then you should be using the View Management to get the Status Bar and hide it using the HideAsync method to hide the status bar as shown below.

async private void Button_Click(object sender, RoutedEventArgs e)
{
  // Get the Status bar for the Current Window.
  Windows.UI.ViewManagement.StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
  // Hides the status bar
  await statusBar.HideAsync();
}

1

    3 Comments

  1. Anderson Benevides
    July 5, 2014
    Reply

    I did a test and displays the following error:
    The ‘await’ operator can only be used within an async method. Consider marking this method with the ‘async’ modifier and changing its return type to ‘Task’.

  2. July 6, 2014
    Reply

    Could you let me kknow more on what was the code snippet that you made test on ?

  3. niksh19
    September 6, 2014
    Reply

    Why can I not show the status bar again after hiding it once.

    I want to make it a toggleable setting – to show / hide the status bar.
    But, after hiding it once, it is not possible to show it again.

    Any advice?

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...