Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

WidgetResourceRequestedArgs Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Provides data for the IWidgetResourceProvider.OnResourceRequested event which is raised when the widget's content requests a resource that matches the web request filter string for a widget in the WebRequestFilter attribute of the Definition element in the provider's package manifest file. For more information, see Widget provider package manifest XML format.

public ref class WidgetResourceRequestedArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Widgets.WidgetContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class WidgetResourceRequestedArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Widgets.WidgetContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class WidgetResourceRequestedArgs
Public NotInheritable Class WidgetResourceRequestedArgs
Inheritance
Object Platform::Object IInspectable WidgetResourceRequestedArgs
Attributes

Remarks

Widget providers can access the resource request through the WidgetResourceRequestedArgs.Request property and set the WidgetResourceRequestedArgs.Response property to a WidgetResourceResponse that contains a stream to the resource and then return. If the evaluation or the resource is not immediately available, the provider should request a deferral by calling WidgetResourceRequestedArgs.GetDeferral, initiate a background task, and complete the deferral when the resource is available.

If the provider returns the OnResourceRequested call without setting a WidgetResourceResponse in the WidgetResourceRequestedArgs, a web fetch will be made. When returning without a WidgetResourceResponse, the provider may modify the Headers collection which will then be used by the web fetch.

Properties

Name Description
Request

Sets the WidgetResourceRequest representing the widget resource request.

Response

Gets or sets the WidgetResourceResponse representing the response to the widget resource request.

WidgetContext

Gets the WidgetContext object associated with the Microsoft.Windows.Widgets.Providers.IWidgetProvider.OnWidgetContextChanged callback.

Methods

Name Description
GetDeferral()

Informs the system that the resource response task might continue to perform work after the IWidgetResourceProvider.OnResourceRequested handler returns.

Applies to


Feedback

Was this page helpful?