Class PageResourceContentLoader
Default implementation of INavigationContentLoader that is capable of resolving URI values to XAML types located in the application deployment XAP.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Navigation
Assembly: Controls.Navigation.OpenSilver.dll
Syntax
public sealed class PageResourceContentLoader : INavigationContentLoader
Methods
| Improve this Doc View SourceBeginLoad(Uri, Uri, AsyncCallback, Object)
Begins asynchronous loading of the provided targetUri
.
Declaration
public IAsyncResult BeginLoad(Uri targetUri, Uri currentUri, AsyncCallback userCallback, object asyncState)
Parameters
Type | Name | Description |
---|---|---|
Uri | targetUri | A URI value to resolve and begin loading. |
Uri | currentUri | The URI that is currently loaded. |
System.AsyncCallback | userCallback | A callback function that will be called when this asynchronous request is ready to have EndLoad(IAsyncResult) called on it. |
System.Object | asyncState | A custom state object that will be returned in System.IAsyncResult.AsyncState, to correlate between multiple async calls. |
Returns
Type | Description |
---|---|
System.IAsyncResult | An System.IAsyncResult that can be passed to CancelLoad(IAsyncResult) at any time, or EndLoad(IAsyncResult) after the |
CancelLoad(IAsyncResult)
Attempts to cancel a pending load operation.
Declaration
public void CancelLoad(IAsyncResult asyncResult)
Parameters
Type | Name | Description |
---|---|---|
System.IAsyncResult | asyncResult | The System.IAsyncResult returned from BeginLoad(Uri, Uri, AsyncCallback, Object) for the operation you wish to cancel. |
Remarks
Cancellation is not guaranteed. Check the result from EndLoad to determine if cancellation was successful.
CanLoad(Uri, Uri)
Tells whether or not the target Uri can be loaded
Declaration
public bool CanLoad(Uri targetUri, Uri currentUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | targetUri | A URI to load |
Uri | currentUri | The current URI |
Returns
Type | Description |
---|---|
System.Boolean | True if the targetURI can be loaded |
EndLoad(IAsyncResult)
Completes the asynchronous loading of content
Declaration
public LoadResult EndLoad(IAsyncResult asyncResult)
Parameters
Type | Name | Description |
---|---|---|
System.IAsyncResult | asyncResult | The result returned from BeginLoad(Uri, Uri, AsyncCallback, Object), and passed in to the callback function. |
Returns
Type | Description |
---|---|
LoadResult | The content loaded, or null if content was not loaded |