SystemTray.SetOpacity Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Sets the value of the Opacity attached property for a specified phone application page.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
'Declaration Public Shared Sub SetOpacity ( _ element As DependencyObject, _ opacity As Double _ )
Parameters
- element
- Type: System.Windows.DependencyObject
The page for which to set the Opacity attached property.
- opacity
- Type: System.Double
The opacity factor to set for the system tray.
Expected values are between 0.0 and 1.0. The opacity of the system tray can be adjusted finely, but we recommend that you use only values of 0.0, 0.5, and 1.0.
0.0 The system tray is completely transparent. The system tray is laid over the contents of the page, which show through. The page is not resized.
0.5 The system tray is partially transparent. The system tray is laid over the contents of the page, which show through. The page is not resized.
1.0 The system tray is completely opaque. The system tray covers the current page. The page is resized to the area of the screen not occupied by the system tray.
The system tray is also referred to as the status bar.
The following code example shows how to use the SystemTray class in conjunction with the ProgressIndicator class.
Imports Microsoft.Phone.Shell Partial Public Class MainPage Inherits PhoneApplicationPage Dim prog As ProgressIndicator Public Sub New() InitializeComponent() SystemTray.SetIsVisible(Me, true) SystemTray.SetOpacity(Me, 0.5) SystemTray.SetBackgroundColor(Me, Colors.Blue) SystemTray.SetForegroundColor(Me, Colors.Yellow) prog = new ProgressIndicator() prog.IsVisible = true prog.IsIndeterminate = true prog.Text = "Click me..." SystemTray.SetProgressIndicator(Me, prog) End Sub End Class