Export (0) Print
Expand All

Frame.Source Property

Gets or sets the uniform resource identifier (URI) of the current content or the content that is being navigated to.

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

public Uri Source { get; set; }
<sdk:Frame Source="uriString"/>

Property Value

Type: System.Uri
A value that represents the URI of the current content or the content that is being navigated to.

Dependency property identifier field: SourceProperty

When you set the Source property to a value that is different from the content being displayed, the frame navigates to the new content.

The following example shows the XAML for a frame that includes URI mapping definitions. The frame will navigate to the value of its Source property, which in this example is set by default to /Home.


<sdk:Frame 
       x:Name="ContentFrame" 
       Style="{StaticResource ContentFrameStyle}" 
       Source="/Home" 
       Navigated="ContentFrame_Navigated" 
       NavigationFailed="ContentFrame_NavigationFailed">
    <sdk:Frame.UriMapper>
        <sdk:UriMapper>
            <sdk:UriMapping 
                Uri="/ProductDetail/{productid}" 
                MappedUri="/Views/ProductDetail.xaml?ProductId={productid}"/>
            <sdk:UriMapping 
                Uri="/Reports/{type}/{selection}" 
                MappedUri="/Views/ReportsPage.xaml?type={type}&amp;selection={selection}"/>
            <sdk:UriMapping 
                Uri="/{pageName}" 
                MappedUri="/Views/{pageName}.xaml"/>
        </sdk:UriMapper>
    </sdk:Frame.UriMapper>
</sdk:Frame>


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

Show:
© 2014 Microsoft