Επεξεργασία

Κοινή χρήση μέσω


PageContent.GetPageRootAsync(Boolean) Method

Definition

Asynchronously loads and returns the FixedPage content element.

public:
 void GetPageRootAsync(bool forceReload);
public void GetPageRootAsync (bool forceReload);
member this.GetPageRootAsync : bool -> unit
Public Sub GetPageRootAsync (forceReload As Boolean)

Parameters

forceReload
Boolean

true to always reload the FixedPage even if it has been previously loaded and cached; false to load the FixedPage only if there is no cached version.

Remarks

GetPageRootAsync asynchronously loads and parses the FixedPage data stream associated with this PageContent. Other threads will continue to run while GetPageRootAsync completes.

The following steps illustrate how to load the FixedPage content asynchronously:

  1. Create a GetPageRootCompletedEventHandler delegate and add it to be notified of GetPageRootCompleted events.

  2. Call GetPageRootAsync.

  3. When the GetPageRootCompleted event occurs and the delegate is called, the FixedPage content has completed loading. The loaded FixedPage element is returned through the GetPageRootCompletedEventArgs.Result property.

For more information about the <PageContent> element, see chapter 3 of the XPS specification which you can obtain at XPS: Specification and License Downloads.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by GetPageRoot(Boolean).

Applies to

See also