CoreInputView CoreInputView CoreInputView CoreInputView Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Enables an app to receive notifications when a docked, undocked, moveable, or transitory input pane (and associated UI) is moved, displayed, or hidden, and to determine which portion of the app's window is obscured by the pane.

With this info, your app can adjust and reflow it's UI to account for any occlusion.

The CoreInputView APIs support the following types of input panes.

  • Docked Soft Input Panel (SIP) like the Touch keyboard and handwriting panel – typically, your app UI reflows
  • Floating toolbar or SIP – typically, your app UI does not reflow
  • Overlay panels such as IME candidate windows – typically, your app UI does not reflow for the edit control, but does reflow for the text/search suggestions
public : sealed class CoreInputView : ICoreInputViewpublic sealed class CoreInputView : ICoreInputViewPublic NotInheritable Class CoreInputView Implements ICoreInputView// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

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

By default, Windows handles input pane events and repositions content so that users can see the control with focus. If you set CoreTextEditContext.InputPaneDisplayPolicy to Manual in your app, you are responsible for showing and hiding the input pane using TryShowPrimaryView and TryHidePrimaryView. Use this class to override the default behavior and customize the input pane.

Call GetForCurrentView to get a CoreInputView object.

After you register to receive input pane notifications, the system calls your event delegate whenever the 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).

Methods

GetCoreInputViewOcclusions() GetCoreInputViewOcclusions() GetCoreInputViewOcclusions() GetCoreInputViewOcclusions()

Prerelease. Gets a reference to each input pane currently occluding the app.

public : IVectorView<CoreInputViewOcclusion> GetCoreInputViewOcclusions()public IReadOnlyList<CoreInputViewOcclusion> GetCoreInputViewOcclusions()Public Function GetCoreInputViewOcclusions() As IReadOnlyList( Of CoreInputViewOcclusion )// You can use this method in JavaScript.
Returns
IVectorView<CoreInputViewOcclusion> IReadOnlyList<CoreInputViewOcclusion> IReadOnlyList<CoreInputViewOcclusion> IReadOnlyList<CoreInputViewOcclusion>

A CoreInputViewOcclusion collection.

GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()

Prerelease. Retrieves the CoreInputView object associated with the current window.

public : static CoreInputView GetForCurrentView()public static CoreInputView GetForCurrentView()Public Static Function GetForCurrentView() As CoreInputView// You can use this method in JavaScript.
Returns

The CoreInputView object associated with the current window.

TryHidePrimaryView() TryHidePrimaryView() TryHidePrimaryView() TryHidePrimaryView()

Prerelease. Tries to hide the InputPane, if it is visible.

public : PlatForm::Boolean TryHidePrimaryView()public bool TryHidePrimaryView()Public Function TryHidePrimaryView() As bool// You can use this method in JavaScript.
Returns
PlatForm::Boolean bool bool bool

true if the request to show the CoreInputView pane was accepted; otherwise false.

If this method is called from an app that is not in foreground, the request is rejected and false is returned.

Remarks

If you set CoreTextEditContext.InputPaneDisplayPolicy to Manual in your app, you are responsible for showing and hiding the input pane using TryShowPrimaryView and TryHidePrimaryView.

TryShowPrimaryView() TryShowPrimaryView() TryShowPrimaryView() TryShowPrimaryView()

Prerelease. Tries to show the CoreInputView pane, if it is hidden.

This method is a "best effort" and guarantees only that the user has a way to interact with the focused control. For a docked a Soft Input Panel (SIP) like the Touch keyboard and handwriting panel, the pane is shown only if a hardware keyboard is not available.

public : PlatForm::Boolean TryShowPrimaryView()public bool TryShowPrimaryView()Public Function TryShowPrimaryView() As bool// You can use this method in JavaScript.
Returns
PlatForm::Boolean bool bool bool

true if the request to show the CoreInputView pane was accepted; otherwise false.

If this method is called from an app that is not in foreground, the request is rejected and false is returned.

Remarks

If you set CoreTextEditContext.InputPaneDisplayPolicy to Manual in your app, you are responsible for showing and hiding the input pane using TryShowPrimaryView and TryHidePrimaryView.

Events

OcclusionsChanged OcclusionsChanged OcclusionsChanged OcclusionsChanged

Prerelease. Occurs when one or more CoreInputViewOcclusion objects change their position or occluding area.

public : event TypedEventHandler OcclusionsChanged<CoreInputView,  CoreInputViewOcclusionsChangedEventArgs>public event TypedEventHandler OcclusionsChanged<CoreInputView,  CoreInputViewOcclusionsChangedEventArgs>Public Event OcclusionsChanged<CoreInputView,  CoreInputViewOcclusionsChangedEventArgs>// You can use this event in JavaScript.