In Windows Phone 7, the System Tray is the small bar across the top of the screen and is currently used to display signal strength, current time and WiFi connection strength of your device. This system tray can be hidden and show on command should you application require it to do so. The following is a demonstration as to how to make this happen.
To begin, design a page with a CheckBox inside it. This will enable the event 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:
Uncheck the “Show System Tray”. This will hide the System Tray bar from the screen.
As mentioned, this can be used to capitalize on screen real estate or can be used in situations were system notification is required.
Pingback: System Tray Customization for Windows Phone 7
Pingback: System Tray Customization for Windows Phone 7 | Silverlight | Scoop.it