ChildWindow.OverlayBrush Property

Silverlight

Gets or sets the visual 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 Brush OverlayBrush { get; set; }
<sdk:ChildWindow OverlayBrush="brushReference"/>

XAML Values

brushReference

A StaticResource reference to a Brush. The media brush is typically one of the following Silverlight classes: LinearGradientBrush, RadialGradientBrush, ImageBrush, SolidColorBrush, or VideoBrush.

Property Value

Type: System.Windows.Media.Brush
The visual brush that is used to cover the parent window when the ChildWindow is open. The default is null.

Dependency property identifier field: OverlayBrushProperty

The overlay is the part of the ChildWindow that covers the parent window.

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

Run this sample

The example brush named overlayGradient is a RadialGradientBrush defined as a XAML resource in the App.xaml file:


<Application.Resources>
    <!-- Gradient for ChildWindow overlay. -->
    <RadialGradientBrush x:Key="overlayGradient">
        <GradientStop Color="#FFA3A7B9" Offset="0"/>
        <GradientStop Color="#FF3F3E4B" Offset="1"/>
        <GradientStop Color="#FF7B98C1" Offset="0.457"/>
    </RadialGradientBrush>
</Application.Resources>


The following shows how to set the OverlayBrush 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 OverlayBrush in code:

this.OverlayBrush = (RadialGradientBrush)App.Current.Resources["overlayGradient"];

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: