Export (0) Print
Expand All

WebBrowserBrush.Redraw Method

Silverlight

Forces the brush to asynchronously redraw itself.

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

public void Redraw()

The Redraw method forces the brush to asynchronously redraw itself. The contents of the WebBrowser will be captured at the time of the Redraw call and Silverlight will update the brush at the next opportunity. If the WebBrowser contains content that is continuously changing, such as video content, you will need to call Redraw regularly to update the WebBrowserBrush.

The following example shows how to use the Redraw method. In this example, the WebBrowserBrush updates its content when the user moves the mouse.


private void LayoutRoot_MouseMove(object sender, MouseEventArgs e)
{
    WBB1.Redraw();
}



<StackPanel x:Name="LayoutRoot" Background="Blue" MouseMove="LayoutRoot_MouseMove">
    <WebBrowser Name="WB1" Source="Hello.html" Height="150" Width="150" />
    <Rectangle Height="150" Width="150" >
        <Rectangle.Fill>
            <WebBrowserBrush SourceName="WB1" Opacity=".5" x:Name="WBB1"/>
        </Rectangle.Fill>
    </Rectangle>
</StackPanel>


Silverlight

Supported in: 5, 4

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