Share via


Silverlight.Source Property

Gets or sets the location of the Silverlight content to display.

Namespace:  System.Web.UI.SilverlightControls
Assembly:  System.Web.Silverlight (in System.Web.Silverlight.dll)

Syntax

'Declaration
<BindableAttribute(True)> _
<ThemeableAttribute(True)> _
Public Overridable Property Source As String
    Get
    Set
'Usage
Dim instance As Silverlight
Dim value As String

value = instance.Source

instance.Source = value
[BindableAttribute(true)]
[ThemeableAttribute(true)]
public virtual string Source { get; set; }

Property Value

Type: System.String
The location of the XAML source file or XAP source package.

Remarks

Use the Source property to specify the URL of the XAML source file or XAP source package.

XAP packages are supported only if the MinimumVersion property is "2.0" or greater.

If the Source property value is a .xaml file, the file cannot contain any Silverlight 2 content. For example, the top-level element in the .xaml file may be a Canvas element, but not a UserControl or StackPanel element, since these are valid only for Silverlight 2 content.

Also, when using a .xaml file as the Source property, there cannot be any attributes in the XAML elements that are valid for only Silverlight 2 content, such as an x:Class attribute since you cannot have managed code code-behind (C# or Visual Basic) files for Silverlight 1.0 content.

Platforms

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

See Also

Reference

Silverlight Class

Silverlight Members

System.Web.UI.SilverlightControls Namespace