XboxGameBarWidgetControl

This object allows you to send control commands to other widgets.

Constructor

XboxGameBarWidget(XboxGameBarWidget widget)

You pass your XboxGameBarWidget object to provide correct context to your control object.

Properties

None

Methods

Activation

Windows.Foundation.Uri CreateActivationUri(String appId, String appExtensionId, String uriSubpath, String uriQuery, String uriFragment)

Helper method to create a launch URI to pass to ActivateWithUriAsync.

Windows.Foundation.IAsyncAction ActivateAsync(String appExtensionId)

Activates a widget given the app widget id. The App Id of the XboxGameBarWidget object is assumed. Leverage this method to launch a widget in the same app as your current widget (the one calling this API).

Windows.Foundation.IAsyncAction ActivateAsync(String appId, String appExtensionId)

Activates a widget given the app id and app widget id. Leverage this method to launch a widget of a different app within your multi-app package.

Windows.Foundation.IAsyncAction ActivateWithUriAsync(Windows.Foundation.Uri uri)

Activates a widget using the full Game Bar URI format. This is the same URI format that you could use to activate Game Bar from Windows itself or a Win32 to app (Windows.System.Launcher.LaunchUriAsync). Keep in mind that Game Bar currently doesn't support URI activation apart from Widget to Widget activation. We hope to support this soon.

Windows.Foundation.IAsyncAction MinimizeAsync(String appExtensionId)

Minimizes a widget given the app id and app widget id. Leverage this method to hide a widget without closing it.

Windows.Foundation.IAsyncAction MinimizeAsync(String appId, String appExtensionId)

Minimizes a widget given the app id and app widget id. Leverage this method to hide a widget from your app package without closing it.

Windows.Foundation.IAsyncAction RestoreAsync(String appExtensionId)

Restores a widget given the app id and app widget id. Leverage this method to restore a previously minimized widget.

Windows.Foundation.IAsyncAction RestoreAsync(String appId, String appExtensionId)

Restores a widget given the app id and app widget id. Leverage this method to restore a previously minimized widget from your app package.

Windows.Foundation.IAsyncAction CloseAsync(String appExtensionId)

Close a widget given the app id and app widget id. Leverage this method to close an active widget.

Windows.Foundation.IAsyncAction CloseAsync(String appId, String appExtensionId)

Close a widget given the app id and app widget id. Leverage this method to close an active widget from your app package.

URI Scheme

ms-gamebar:[//coreCommand/][widgetCommand]/[widgetId][?query][#fragment]

coreCommand [optional] - Determines core behavior for Game Bar launch

Command Definition
launch This is the same core command if the authority/host is omitted from the URI. Game Bar will launch normally unless there's a widgetCommand specified.
others All others are currently private to Game Bar

widgetCommand - Allowed if authority/host is omitted or 'launch'. Can be one of the following:

Command Use
activate Activates a widget
activateMinimized Activates a widget minimized if not already running otherwise preserves current window state
minimize Minimizes a widget
restore Restores a widget
close Closes a widget

widgetId- Required if there's a widget command.

Format: <packageFamilyName>_<appId>_<appExtensionId>

[?query] - Defined by each widget

[#fragment] - Defined by each widget

Window Management

Windows.Foundation.IAsyncAction MinimizeAsync(String appExtensionId)

Minimizes a widget given the app widget id. The App Id of the XboxGameBarWidget object is assumed.

Windows.Foundation.IAsyncAction MinimizeAsync(String appId, String appExtensionId)

Minimizes a widget given the app id and app widget id.

Windows.Foundation.IAsyncAction RestoreAsync(String appExtensionId)

Restores a widget given the app widget id. The App Id of the XboxGameBarWidget object is assumed.

Windows.Foundation.IAsyncAction RestoreAsync (String appId, String appExtensionId)

Restores a widget given the app id and app widget id.

Windows.Foundation.IAsyncAction CloseAsync(String appExtensionId)

Closes a widget given the app widget id. The App Id of the XboxGameBarWidget object is assumed.

Windows.Foundation.IAsyncAction CloseAsync (String appId, String appExtensionId)

Closes a widget given the app id and app widget id.