InputPane InputPane InputPane Class

Definition

Enables an app to receive notifications when the input pane is about to be displayed or hidden, and to determine which portion of the application's window is obscured by the input pane.

The input pane appears when the user performs an action that requires them to enter information, such as selecting a text entry field.

Note

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

public sealed class InputPane : IInputPane, IInputPane2, IInputPaneControlpublic sealed class InputPane : IInputPane, IInputPane2, IInputPaneControlPublic NotInheritable Class InputPane Implements IInputPane, IInputPane2, IInputPaneControl
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

By default, Windows handles the input pane events and repositions content so that users can see where they are typing. Use this class to override this default behavior and create your own custom input pane.

Call GetForCurrentView to get an InputPane object.

After you register to receive input pane notifications, the system calls your event delegate whenever the input pane is shown or hidden for the window that was visible when you called the GetForCurrentView method.

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Properties

OccludedRect OccludedRect OccludedRect

Gets the region of the app window obscured by the input pane.

public Rect OccludedRect { get; }public Rect OccludedRect { get; }Public ReadOnly Property OccludedRect As Rect
Value
Rect Rect Rect

The rectangle, in client coordinates, representing the region of the app window hidden behind the input pane. Specified in device-independent pixel (DIP).

A top value of "0" indicates that the app window is not obstructed by the input pane. The input pane might still be visible.

A height value of "0", and width value equal to the width of the input pane, indicates that the input pane is floating, but not obstructing the app window.

Attributes

Remarks

Universal apps should use this property, rather than Visible.

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

Visible Visible Visible

Gets or sets a value that indicates whether the input pane is shown.

Important

Valid for Xbox device family only.

For universal apps, the OccludedRect property indicates the region of the app window obstructed by the input pane.

public bool Visible { get; set; }public bool Visible { get; set; }Public ReadWrite Property Visible As bool
Value
bool bool bool

true if the input pane is shown; otherwise, false.

Attributes

Remarks

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

Methods

GetForCurrentView() GetForCurrentView() GetForCurrentView()

Gets the InputPane object associated with the application window that is currently visible.

public static InputPane GetForCurrentView()public static InputPane GetForCurrentView()Public Static Function GetForCurrentView() As InputPane
Returns

The input pane.

Attributes

Remarks

This method is the only way to get an input pane object; you can't use the new operator to get a new input pane object.

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

TryHide() TryHide() TryHide()

Hides the InputPane if it is showing.

public bool TryHide()public bool TryHide()Public Function TryHide() As bool
Returns
bool bool bool

true if the InputPane was hidden successfully; otherwise false.

Attributes

Remarks

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

TryShow() TryShow() TryShow()

Shows the InputPane if it is hidden.

public bool TryShow()public bool TryShow()Public Function TryShow() As bool
Returns
bool bool bool

true if the InputPane was shown successfully; otherwise false.

Attributes

Remarks

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

Events

Hiding Hiding Hiding

Occurs when the input pane starts sliding out of view.

public event TypedEventHandler Hidingpublic event TypedEventHandler HidingPublic Event Hiding
Attributes

Remarks

The system associates the input pane with the application window that was visible when you called the GetForCurrentView method. This implies that you must create a new input pane object and register for the Showing event each time you create a new window. You can use the Hiding event to undo changes you may have made to your app's layout during the Showing event.

When the system calls your event handler, the input pane has not started to slide out of view. After your event handler returns, the input pane starts to slide out of view. If your event handler doesn't respond quickly enough (within 200 milliseconds), the input pane starts to slide out of view without waiting for your event handler to return.

If you create a custom user experience for the input pane, make sure to set the EnsuredFocusedElementInView property on the event arguments to notify the app framework that you have handled the input pane event and it should not try to do so for you.

You should minimize the amount of work you do while the input pane is being hidden because multiple animations and content resizes may be happening simultaneously. The more work you do during this period affects the overall system performance, causing a poor user experience.

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.

Showing Showing Showing

Occurs when the input pane starts sliding into view.

public event TypedEventHandler Showingpublic event TypedEventHandler ShowingPublic Event Showing
Attributes

Remarks

The system associates the input pane with the application window that was visible when you called the GetForCurrentView method. This implies that you must create a new input pane object and register for the Showing event each time you create a new window.

When the system calls your event handler, the input pane has not started to slide into view. After your event handler returns, the input pane starts to slide into view. If your event handler doesn't respond quickly enough (within 200 milliseconds), the input pane starts to slide into view without waiting for your event handler to return.

You can use the Showing event to create a custom user experience when the input pane is displayed. For example, in an instant messenger app, you might want to resize the chat window and input box to fit above the input pane so that the user never has to scroll to see new messages. If you do create a custom user experience, make sure to set the EnsuredFocusedElementInView property on the event arguments to notify the app framework that you have handled the input pane event and it should not try to do so for you.

You should minimize the amount of work you do while the input pane is being shown because multiple animations and content resizes may be happening simultaneously. The more work you do during this period affects the overall system performance, causing a poor user experience.

In some cases, overlay UI such as an InputPane is not fully supported. This includes:+ apps in full-screen mode.