Dela via


ContentPrefetchTrigger Class

Definition

Provides the ability to run custom handlers when prefetching web resources.

public ref class ContentPrefetchTrigger sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class ContentPrefetchTrigger final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class ContentPrefetchTrigger final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class ContentPrefetchTrigger
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.IContentPrefetchTriggerFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ContentPrefetchTrigger
function ContentPrefetchTrigger(waitInterval)
Public NotInheritable Class ContentPrefetchTrigger
Inheritance
Object Platform::Object IInspectable ContentPrefetchTrigger
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

Developers can attach a handler to preload and cache web content so an app can launch and have its content refreshed and up to date. Accessing cached content helps reduce app activation time by not having to queue costly web requests.

In addition to custom tasks, the existing ContentPrefetcher API is still available and can be used instead of the custom task when the prerequisite work only involves preloading and caching content from a fixed or dynamic set of URIs.

Constructors

ContentPrefetchTrigger()

Initializes a new instance of the ContentPrefetchTrigger class.

ContentPrefetchTrigger(TimeSpan)

Initializes a new instance of the ContentPrefetchTrigger class using a specified time interval.

Properties

WaitInterval

Retrieves the time interval for prefetching web content.

Applies to

See also