UriMapper.MapUri Method

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

Converts a specified uniform resource identifier (URI) into a new URI based on the rules of a matching object in the UriMappings collection.

Namespace: System.Windows.Navigation
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)

Syntax

Public Overrides Function MapUri ( _
    uri As Uri _
) As Uri
public override Uri MapUri(
    Uri uri
)

Parameters

  • uri
    Type: System..::.Uri
    Original URI value to be converted to a new URI.

Return Value

Type: System..::.Uri
A URI to use for handling the request instead of the value of the uri parameter. If no object in the UriMappings collection matches uri, the original value for uri is returned.

Exceptions

Exception Condition
InvalidOperationException

The UriMappings property is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

The MapUri method returns the mapped URI value from the first object in the UriMappings collection that matches the uri value. If more than one object in the collection matches the uri value, only the mapped URI from the first instance in the collection is returned.

An object in the UriMappings collection matches the uri value if the MapUri for that instance of the UriMapping class returns a value.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

UriMapper Class

System.Windows.Navigation Namespace

Other Resources

In-app navigation for Windows Phone 8