Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Know About WP7 System Tray - Tips to Show or Hide it

, 28 Sep 2011
Rate this:
Please Sign up or sign in to vote.
In Windows Phone 7, the System Tray is the small bar across the top of the screen in Portrait mode. It displays the Signal strength, Current time and Wi-Fi connection strength.   In this post, we will learn more about Windows Phone 7 System Tray. It is easy to write code to show or hide the tray.

In Windows Phone 7, the System Tray is the small bar across the top of the screen in Portrait mode. It displays the Signal strength, Current time and Wi-Fi connection strength.

In this post, we will learn more about Windows Phone 7 System Tray. It is easy to write code to show or hide the tray. We will use a small demo to demonstrate it.

System Tray

System Tray is the small tiny bar across the top of the Phone screen. It displays in Portrait mode. When your application is set in Portrait mode, the height of the System Tray becomes 32 pixel and when the application is set in Landscape mode, the width of the System Tray becomes 72 pixel. This is as per the UI Design Guidelines and Interaction Guideline of Windows Phone 7.

It is not good way to hide the System Tray as it displays various important information to the user. But in some case, you may want to hide the System Tray.

Demonstration of Show/Hide

To start with the code, let us design our page with a CheckBox inside it. This will fire the event to show or hide the System Tray. We will add a CheckBox in the page to show or hide the System Tray. Here is the XAML code for your reference:

 
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" VerticalAlignment="Top">
    <CheckBox Content="Show System Tray" Checked="ShowSystemTray" Unchecked="HideSystemTray"/>
</Grid>

Here is the code implementation:

 
private void ShowSystemTray(object sender, RoutedEventArgs e)
{
    SystemTray.IsVisible = true;
}
 
private void HideSystemTray(object sender, RoutedEventArgs e)
{
    SystemTray.IsVisible = false;
}

When the “Show System Tray” is checked, you will see the System Tray bar at the top of the screen as shown in the first figure below:

Show System Tray                      Hide System Tray

Uncheck the “Show System Tray”. This will hide the System Tray bar from the screen. Hope, this tip was helpful for you to understand it clearly.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

_ Kunal Chowdhury _
Technical Lead
India India
Kunal Chowdhury is a Microsoft "Client Development" MVP (Most Valuable Professional), a Codeproject Mentor, Telerik MVP, Nokia Developer Champion, Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession.
 
He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows 8 (WinRT). He posts his findings, articles in his technical blog and CodeProject.
 
Technical Blog: http://www.kunal-chowdhury.com
Facebook: http://facebook.com/blog.kunal
Twitter : http://twitter.com/kunal2383
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 28 Sep 2011
Article Copyright 2011 by _ Kunal Chowdhury _
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid