Share via


IWidgetProvider Interface

Definition

This interface is implemented by Windows Widget providers to receive callbacks from the widget host for widget lifetime events.

public interface class IWidgetProvider
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.Widgets.WidgetContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1549235404, 29344, 17709, 185, 237, 7, 92, 13, 210, 94, 237)]
struct IWidgetProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.Widgets.WidgetContract), 65536)]
[Windows.Foundation.Metadata.Guid(1549235404, 29344, 17709, 185, 237, 7, 92, 13, 210, 94, 237)]
public interface IWidgetProvider
Public Interface IWidgetProvider
Attributes

Remarks

This interface be implemented as an Out-of-process COM Server. The lifetime of a widget provider is independent of its widgets' lifetimes; a widget provider can be activated and released by the widgetm anager at any time. Multiple providers for the same provider app will be run in a shared process. Providers from different provider apps will run in separate processes.

Objects passed into the callback methods of the IWidgetProvider interface are only guaranteed to be valid within the callback. You should not store references to these objects because their behavior outside of the context of the callback is undefined.

For an overview of Windows Widgets, see Widgets overview. For information about developing a widget provider, see Widget service providers.

Methods

Activate(WidgetContext)

Notifies the widget provider that the widget host is currently interested in receiving updated content from the provider.

CreateWidget(WidgetContext)

Notifies the widget provider that a new widget has been created, for example, when a user adds a widget to a widget host.

Deactivate(String)

Notifies the widget provider that the widget host is no longer actively requesting updated content from the provider.

DeleteWidget(String, String)

Notifies the widget provider that one of the widgets it supports has been deleted, for example, when a user removes a widget from a widget host.

OnActionInvoked(WidgetActionInvokedArgs)

Called when an action is invoked on a widget, such as the user clicking on a button.

OnWidgetContextChanged(WidgetContextChangedArgs)

Called when the configuration of the widget within the widget host changes.

Applies to