IWidgetResourceProvider Interface
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.
This optional interface can be implemented by a widget provider to monitor, provide, or alter resources that are requested by the widget web content.
public interface class IWidgetResourceProvider
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Widgets.WidgetContract, 393216)]
/// [Windows.Foundation.Metadata.Guid(3706923200, 300, 16629, 187, 40, 58, 28, 113, 77, 2, 125)]
struct IWidgetResourceProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Widgets.WidgetContract), 393216)]
[Windows.Foundation.Metadata.Guid(3706923200, 300, 16629, 187, 40, 58, 28, 113, 77, 2, 125)]
public interface IWidgetResourceProvider
Public Interface IWidgetResourceProvider
- Attributes
Remarks
Widget providers can specify a web request filter string for a widget in the WebRequestFilter attribute of the Definition element in the provider's package manifest file. Whenever the widget content requests a resource by URI that matches the filter, the request will be intercepted and redirected to the widget provider's implementation of IWidgetResourceProvider.OnResourceRequested.
The filter pattern is expressed using the format described in Match Patterns. The filter string in the registration must use Punycode where necessary. All content types will be redirected when matched so the filter should only resolve to content intended to be obtained through the IWidgetResourceProvider in the application.
Every GET, PUT or UPDATE request made by a widget web app that matches its registered filter must also match the the origin of the widget registration, specified in the ContentUri attribute of the Definition element in the provider's package manifest file. If the resource does not match in origin, the request will be ignored.
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.
Methods
OnResourceRequested(WidgetResourceRequestedArgs) |
Raised when the widget's web 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. |