GameBar Class

Definition

Provides notifications and information about the visibility and input redirection state of Game bar.

public ref class GameBar abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GameBar final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class GameBar
Public Class GameBar
Inheritance
Object Platform::Object IInspectable GameBar
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)

Remarks

The events and properties of are class static. Objects are not instantiated for this class.

Properties

IsInputRedirected

Indicates whether input is currently redirected to Game bar.

After the user invokes Game bar, input may be redirected to Game bar while the player interacts with it. Games that are no longer receiving input will typically want to pause gameplay or present an idle state. While paused or idle, a best practice is to continue rendering the current frame or scene, so that the recording is smooth and seamless if the player begins recording or is already recording. Multiplayer games might choose to continue gameplay rather than to pause.

To be notified of changes to , handle the IsInputRedirectedChanged event.

Visible

Indicates whether Game bar is currently visible.

Use the property to determine the visibility state of Game bar. Games can choose to pause gameplay or present an idle state when Game bar is visible and being drawn over the game. While paused or idle, a best practice is to continue rendering the current frame or scene, so that the recording is smooth and seamless if the player begins recording or is already recording. Multiplayer games might choose to continue gameplay rather than to pause.

To be notified of changes to , handle the VisibilityChanged event.

Events

IsInputRedirectedChanged

Occurs when input is redirected to Game bar or input is restored to the game.

After the user invokes Game bar, input may be redirected to Game bar while the player interacts with it. Games that are no longer receiving input will typically want to pause gameplay or present an idle state. While paused or idle, a best practice is to continue rendering the current frame or scene, so that the recording is smooth and seamless if the player begins recording or is already recording. Multiplayer games might choose to continue gameplay rather than to pause.

Tip

This event can be raised on background (non-UI) threads. You may need to post an event to the UI thread to perform UI actions.

Use IsInputRedirected to determine whether input is currently redirected to Game bar.

VisibilityChanged

Occurs when Game bar is shown or dismissed.

Use the event to monitor the visibility state of Game bar. Games can choose to pause gameplay or present an idle state when Game bar is visible and being drawn over the game. While paused or idle, a best practice is to continue rendering the current frame or scene, so that the recording is smooth and seamless if the player begins recording or is already recording. Multiplayer games might choose to continue gameplay rather than to pause.

Tip

This event can be raised on background (non-UI) threads. You may need to post an event to the UI thread to perform UI actions.

Use Visible to determine whether Game bar is currently visible.

Applies to