UriMapping.MapUri Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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:  Microsoft.Phone (in Microsoft.Phone.dll)

Syntax

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 nullNothingnullptra null reference (Nothing in Visual Basic) if the URI cannot be converted.

Exceptions

Exception Condition
InvalidOperationException

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

-or-

MappedUri is nullNothingnullptra 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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

UriMapping Class

System.Windows.Navigation Namespace

Other Resources

In-app navigation for Windows Phone 8