UINavigationController UINavigationController UINavigationController UINavigationController Class

Definition

Represents a controller of any type that can be used for UI navigation. Most gamepads, arcade sticks, and racing wheels can also be accessed as a UINavigationController. It is recommended that games use the controller-specific class during gameplay and the UINavigationController class for UI menus.

public : sealed class UINavigationController : IGameController, IGameControllerBatteryInfo, IUINavigationControllerpublic sealed class UINavigationController : IGameController, IGameControllerBatteryInfo, IUINavigationControllerPublic NotInheritable Class UINavigationController Implements IGameController, IGameControllerBatteryInfo, IUINavigationController// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Properties

Headset Headset Headset Headset

The audio headset attached to the UI navigation controller.

public : Headset Headset { get; }public Headset Headset { get; }Public ReadOnly Property Headset As Headset// You can use this property in JavaScript.
Value
Headset Headset Headset Headset

The audio headset attached to the UI navigation controller.

IsWireless IsWireless IsWireless IsWireless

Gets a value that indicates the wireless state of the UI navigation controller.

public : PlatForm::Boolean IsWireless { get; }public bool IsWireless { get; }Public ReadOnly Property IsWireless As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the UI navigation controller is wireless. Otherwise, false.

UINavigationControllers UINavigationControllers UINavigationControllers UINavigationControllers

The list of all connected UI navigation controllers.

public : static IVectorView<UINavigationController> UINavigationControllers { get; }public static IReadOnlyList<UINavigationController> UINavigationControllers { get; }Public Static ReadOnly Property UINavigationControllers As IReadOnlyList<UINavigationController>// You can use this property in JavaScript.
Value
IVectorView<UINavigationController> IReadOnlyList<UINavigationController> IReadOnlyList<UINavigationController> IReadOnlyList<UINavigationController>

The list of all connected UI navigation controllers.

User User User User

The user associated with the UI navigation controller.

public : User User { get; }public User User { get; }Public ReadOnly Property User As User// You can use this property in JavaScript.
Value
User User User User

The user associated with the UI navigation controller.

Methods

FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController)

Returns the given game controller as a UI navigation controller.

public : static UINavigationController FromGameController(IGameController gameController)public static UINavigationController FromGameController(IGameController gameController)Public Static Function FromGameController(gameController As IGameController) As UINavigationController// You can use this method in JavaScript.
Parameters
gameController
IGameController IGameController IGameController IGameController

The game controller to be returned as a UI navigation controller.

Returns

The UI navigation controller that was returned from the given game controller.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Examples

In the following example, the app gets the first available RawGameController object, and tries to access this game controller via the UINavigationController class:

UINavigationController^ uiNavigationController;

if (RawGameController::RawGameControllers->Size > 0)
{
    RawGameController^ rawGameController = 
        RawGameController::RawGameControllers->GetAt(0);

    uiNavigationController = 
        UINavigationController::FromGameController(rawGameController);
}

if (uiNavigationController != nullptr)
{
    // Assign a standard button mapping to this controller.
}

Remarks

This method checks if the provided game controller has a UI navigation controller implementation, and if so, it returns that implementation. You might use this method if you want to first get the controller as a RawGameController, and then see if it can be used as a UINavigationController—if so, you can use a default control scheme for UI navigation controllers, otherwise you can let the player do their own input mapping.

GetCurrentReading() GetCurrentReading() GetCurrentReading() GetCurrentReading()

Gets a snapshot of the UI navigation controller's state.

public : UINavigationReading GetCurrentReading()public UINavigationReading GetCurrentReading()Public Function GetCurrentReading() As UINavigationReading// You can use this method in JavaScript.
Returns

GetOptionalButtonLabel(OptionalUINavigationButtons) GetOptionalButtonLabel(OptionalUINavigationButtons) GetOptionalButtonLabel(OptionalUINavigationButtons) GetOptionalButtonLabel(OptionalUINavigationButtons)

Retrieves a label for an optional UI navigation button.

public : GameControllerButtonLabel GetOptionalButtonLabel(OptionalUINavigationButtons button)public GameControllerButtonLabel GetOptionalButtonLabel(OptionalUINavigationButtons button)Public Function GetOptionalButtonLabel(button As OptionalUINavigationButtons) As GameControllerButtonLabel// You can use this method in JavaScript.
Parameters
button
OptionalUINavigationButtons OptionalUINavigationButtons OptionalUINavigationButtons OptionalUINavigationButtons

Enumeration indicating the UI navigation button whose label to retrieve.

Returns

GetRequiredButtonLabel(RequiredUINavigationButtons) GetRequiredButtonLabel(RequiredUINavigationButtons) GetRequiredButtonLabel(RequiredUINavigationButtons) GetRequiredButtonLabel(RequiredUINavigationButtons)

Retrieves a label for a required UI navigation button.

public : GameControllerButtonLabel GetRequiredButtonLabel(RequiredUINavigationButtons button)public GameControllerButtonLabel GetRequiredButtonLabel(RequiredUINavigationButtons button)Public Function GetRequiredButtonLabel(button As RequiredUINavigationButtons) As GameControllerButtonLabel// You can use this method in JavaScript.
Parameters
button
RequiredUINavigationButtons RequiredUINavigationButtons RequiredUINavigationButtons RequiredUINavigationButtons

Enumeration indicating the UI navigation button whose label to retrieve.

Returns

TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport()

Gets information about the UI navigation controller's current battery state.

public : BatteryReport TryGetBatteryReport()public BatteryReport TryGetBatteryReport()Public Function TryGetBatteryReport() As BatteryReport// You can use this method in JavaScript.
Returns

Information about the UI navigation controller's current battery state.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Events

HeadsetConnected HeadsetConnected HeadsetConnected HeadsetConnected

Signals when a headset is attached to the UI navigation controller.

public : event TypedEventHandler HeadsetConnected<IGameController,  Headset>public event TypedEventHandler HeadsetConnected<IGameController,  Headset>Public Event HeadsetConnected<IGameController,  Headset>// You can use this event in JavaScript.

HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected

Signals when a headset is disconnected from the UI navigation controller.

public : event TypedEventHandler HeadsetDisconnected<IGameController,  Headset>public event TypedEventHandler HeadsetDisconnected<IGameController,  Headset>Public Event HeadsetDisconnected<IGameController,  Headset>// You can use this event in JavaScript.

UINavigationControllerAdded UINavigationControllerAdded UINavigationControllerAdded UINavigationControllerAdded

Signals when a new UI navigation controller is connected.

public : static event EventHandler UINavigationControllerAdded<UINavigationController>public static event EventHandler UINavigationControllerAdded<UINavigationController>Public Static Event UINavigationControllerAdded<UINavigationController>// You can use this event in JavaScript.

Remarks

To identify controllers that have already been added, you query the list of connected controllers using UINavigationController.UINavigationControllers.

UINavigationControllerRemoved UINavigationControllerRemoved UINavigationControllerRemoved UINavigationControllerRemoved

Signals when a UI navigation controller is disconnected.

public : static event EventHandler UINavigationControllerRemoved<UINavigationController>public static event EventHandler UINavigationControllerRemoved<UINavigationController>Public Static Event UINavigationControllerRemoved<UINavigationController>// You can use this event in JavaScript.

UserChanged UserChanged UserChanged UserChanged

Signals when the user associated with the UI navigation controller has changed.

public : event TypedEventHandler UserChanged<IGameController,  UserChangedEventArgs>public event TypedEventHandler UserChanged<IGameController,  UserChangedEventArgs>Public Event UserChanged<IGameController,  UserChangedEventArgs>// You can use this event in JavaScript.

See Also