INavigationContentLoader.BeginLoad Method

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

Begins asynchronous loading of the content for the specified target URI.

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

Syntax

'Declaration
Function BeginLoad ( _
    targetUri As Uri, _
    currentUri As Uri, _
    userCallback As AsyncCallback, _
    asyncState As Object _
) As IAsyncResult
IAsyncResult BeginLoad(
    Uri targetUri,
    Uri currentUri,
    AsyncCallback userCallback,
    Object asyncState
)

Parameters

  • targetUri
    Type: System.Uri
    The URI to load content for.
  • currentUri
    Type: System.Uri
    The URI that is currently loaded.
  • asyncState
    Type: System.Object
    An object for storing custom state information.

Return Value

Type: System.IAsyncResult
An object that stores information about the asynchronous operation.

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 begin loading the content that corresponds to the targetUri value. The EndLoad method is typically called from the specified userCallback method to retrieve the loaded content or a redirection URI. In this case, the argument passed to the userCallback method is passed to the EndLoad method.

Alternately, the userCallback parameter can be nulla null reference (Nothing in Visual Basic) and the EndLoad method can be called with the return value of the BeginLoad method. In this case, the EndLoad method will block until the operation completes.

The asyncState parameter can be used to pass a custom object that can be retrieved from the argument passed to the userCallback method. This is primarily used for distinguishing between multiple BeginLoad method calls.

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.