Share via


INavigationContentLoader.CanLoad Method

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

Gets a value that indicates whether the specified URI can be loaded.

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

Syntax

'Declaration
Function CanLoad ( _
    targetUri As Uri, _
    currentUri As Uri _
) As Boolean
bool CanLoad(
    Uri targetUri,
    Uri currentUri
)

Parameters

  • currentUri
    Type: System.Uri
    The URI that is currently loaded.

Return Value

Type: System.Boolean
true if the URI can be loaded; otherwise, false.

Remarks

Typically, you will not call this method directly unless you implement an alternative to the Silverlight navigation system.

This method is called by the navigation system to determine whether a particular URI is available for navigation. For example, this method is used to determine whether a URI is in the correct format. If the BeginLoad method is called with a URI that cannot be loaded, the Frame.NavigationFailed event occurs. If the event is not handled, an exception is thrown.

Version Information

Silverlight

Supported in: 5, 4

Platforms

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