Export (0) Print
Expand All

ChildWindow.OverlayOpacity Property

Silverlight

Gets or sets the opacity of the overlay brush that is used to cover the parent window when the child window is open.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

public double OverlayOpacity { get; set; }
<sdk:ChildWindow OverlayOpacity="double"/>

Property Value

Type: System.Double
The opacity of the overlay brush that is used to cover the parent window when the ChildWindow is open. The default is 1.0.

Dependency property identifier field: OverlayOpacityProperty

OverlayOpacity determines how much the parent window shows through the overlay area. A value of 0.0 is completely transparent; a value of 1.0 is completely opaque. An OverlayBrush might have its own opacity setting that will affect the overall opacity of the overlay area. For example, the parent window will show through a semi-transparent OverlayBrush even if the OverlayOpacity is set to 1.0.

The following example demonstrates how to set the OverlayOpacity in XAML and code. This example is part of a larger example available in the ChildWindow class overview.

Run this sample

The following shows how to set the OverlayOpacity in XAML:


<!-- NOTE: 
  By convention, the sdk prefix indicates a URI-based XAML namespace declaration 
  for Silverlight SDK client libraries. This namespace declaration is valid for 
  Silverlight 4 only. In Silverlight 3, you must use individual XAML namespace 
  declarations for each CLR assembly and namespace combination outside the scope 
  of the default Silverlight XAML namespace. For more information, see the help 
  topic "Prefixes and Mappings for Silverlight Libraries". 
-->
<sdk:ChildWindow x:Class="ChildWindowSplash.SplashWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           Width="200" Height="150"
           HasCloseButton="False"
           OverlayBrush="{StaticResource overlayGradient}"
           OverlayOpacity="0.85">


The following shows how to set the OverlayOpacity in code:

this.OverlayOpacity = 0.85;

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft