UIViewSettings.GetPreferredInteractionMode(UserInteractionMode[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Of the passed-in values, and based on the current system state, retrieves the system's preferred (most appropriate) user interaction mode among the modes it supports. You can get the user interaction mode that's currently in effect for a system from UserInteractionMode.
public:
virtual UserInteractionMode GetPreferredInteractionMode(Platform::Array <UserInteractionMode> ^ supportedModes) = GetPreferredInteractionMode;
UserInteractionMode GetPreferredInteractionMode(winrt::array_view <UserInteractionMode> const& supportedModes);
public UserInteractionMode GetPreferredInteractionMode(UserInteractionMode[] supportedModes);
function getPreferredInteractionMode(supportedModes)
Public Function GetPreferredInteractionMode (supportedModes As UserInteractionMode()) As UserInteractionMode
Parameters
- supportedModes
- UserInteractionMode[]
A list of user interaction modes for the system to choose a preferred one from. You must pass at least one value. And UserInteractionMode.Mouse must be one of the values.
Returns
Returns the system's preferred (most appropriate) user interaction mode among the modes it supports.
If the API is present but not supported, then it will return UserInteractionMode.Mouse.
Windows requirements
| Device family |
Windows 11, version 24H2 (introduced in 10.0.26100.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v19.0)
|
Remarks
The system's preferred user interaction mode indicates the input modality for which you should optimize your app's user interface. For example, if the preferred interaction mode is touch, then for easier touchability your app might want to add extra padding around the controls in its user interface (UI).
Applies to
See also
- <xref:Windows.UI.ViewManagement.UIViewSettings.UserInteractionMode%0aE%3aWindows.UI.ViewManagement.UIViewSettings.PreferredInteractionModeChanged>