DocumentPaginator.GetPageAsync Method (Int32, Object)
.NET Framework (current version)
Asynchronously returns (through the GetPageCompleted event) the DocumentPage for the specified page number and assigns the specified ID to the asynchronous task.
PresentationCore (in PresentationCore.dll)
public virtual void GetPageAsync(
This overload of the method makes it possible to cancel this asynchronous operation without cancelling all asynchronous operations.
This method raises the GetPageCompleted event. The DocumentPage is passed to the event as one of the event arguments.
The following steps illustrate how to retrieve a DocumentPage asynchronously:
Create a GetPageCompletedEventHandler delegate and add it to be notified of GetPageCompleted events.
Call GetPageAsync(Int32, Object) specifying the pageNumber desired and a unique userState, which will be used to identify the completion of the asynchronous event.
When the event occurs and the delegate is called, compare the event's GetPageCompletedEventArgs.UserState property with the original GetPageAsync(Int32, Object) userState parameter. (The GetPageCompletedEventArgs.PageNumber property will also match the pageNumber specified in the GetPageAsync(Int32, Object) call.)
When the GetPageCompletedEventArgs.UserState property matches the original GetPageAsync(Int32, Object) userState, the operation is complete and the page is ready.
Call GetPage to retrieve the formatted DocumentPage.
Return to top
Available since 3.0