Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

UriMapping.MappedUri Property

Silverlight

Gets or sets the uniform resource identifier (URI) that is navigated to instead of the originally requested URI.

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

public Uri MappedUri { get; set; }
<sdk:UriMapping MappedUri="uriString"/>

Property Value

Type: System.Uri
The URI that the requested URI is converted to.

When a requested URI matches the pattern you specify in the Uri property, the Silverlight framework navigates to the URI you specify in the MappedUri property. Typically, you set the Uri property to a user-friendly value, such as Home, and you set the MappedUri property to the actual file to use for the request, such as /Views/HomePage.xaml.

The following example shows an instance of UriMapper that is defined within a frame named ContentFrame. The element contains a collection of UriMapping objects.


<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

ADD
Show:
© 2015 Microsoft