VideoBrush.SetSource Method (MediaElement)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Sets the source of the VideoBrush using a media file source from an intermediary MediaElement control.

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


Public Sub SetSource ( _
    source As MediaElement _
public void SetSource(
    MediaElement source



You typically use SetSource rather than SourceName for cases where the MediaElement source is not already declared in markup and is instead instantiated in runtime code.

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1


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