Freigeben über


UriMapping.MapUri Method

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

Converts the specified uniform resource identifier (URI) to a new URI, if the specified URI matches the defined template for converting.

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

Syntax

'Declaration
Public Function MapUri ( _
    uri As Uri _
) As Uri
public Uri MapUri(
    Uri uri
)

Parameters

Return Value

Type: System.Uri
The URI that has been converted or nulla null reference (Nothing in Visual Basic) if the URI cannot be converted.

Exceptions

Exception Condition
InvalidOperationException

Uri is nulla null reference (Nothing in Visual Basic).

-or-

MappedUri is nulla null reference (Nothing in Visual Basic).

-or-

Uri includes a query string.

-or-

Uri includes a content fragment.

Remarks

The MapUri method determines whether the value of uri parameter matches the pattern specified in the Uri property. If the two values match, the MapUri method returns the value of the MappedUri property.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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