ViewModePreferences ViewModePreferences ViewModePreferences ViewModePreferences 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.]
Represents the preferred settings to be applied to a view when it's changed to a new view mode.

public : sealed class ViewModePreferences : IViewModePreferences, IViewModePreferences2public sealed class ViewModePreferences : IViewModePreferences, IViewModePreferences2Public NotInheritable Class ViewModePreferences Implements IViewModePreferences, IViewModePreferences2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

To get an instance of ViewModePreferences, call the CreateDefault method.

These view mode preferences are requested values only. The system might override these values when your app is changed to the new view mode. Custom sizes that you specify are not guaranteed to be honored by Windows, so you should not write code that relies on never getting into a size that is smaller than the preferred minimum size or larger than the preferred maximum size. No error is returned when a preferred size is ignored.

Properties

CustomSize CustomSize CustomSize CustomSize

Gets or sets a custom preferred size for the app window.

public : Size CustomSize { get; set; }public Size CustomSize { get; set; }Public ReadWrite Property CustomSize As Size// You can use this property in JavaScript.
Value
Size Size Size Size

The preferred size for the app window.

Remarks

If you set this property, you must also set the ViewSizePreference property value to ViewSizePreference.Custom. Otherwise, the custom size value set here is ignored.

ViewSizePreference ViewSizePreference ViewSizePreference ViewSizePreference

Gets or sets the preferred size of the app window.

public : ViewSizePreference ViewSizePreference { get; set; }public ViewSizePreference ViewSizePreference { get; set; }Public ReadWrite Property ViewSizePreference As ViewSizePreference// You can use this property in JavaScript.
Value
ViewSizePreference ViewSizePreference ViewSizePreference ViewSizePreference

A value of the enumeration that indicates the preferred size of the app window.

Methods

CreateDefault(ApplicationViewMode) CreateDefault(ApplicationViewMode) CreateDefault(ApplicationViewMode) CreateDefault(ApplicationViewMode)

Creates a new instance of ViewModePreferences with default property values set for the specified view mode.

public : static ViewModePreferences CreateDefault(ApplicationViewMode mode)public static ViewModePreferences CreateDefault(ApplicationViewMode mode)Public Static Function CreateDefault(mode As ApplicationViewMode) As ViewModePreferences// You can use this method in JavaScript.
Parameters
mode
ApplicationViewMode ApplicationViewMode ApplicationViewMode ApplicationViewMode

The view mode to set default preferences for.

Returns

A new instance of ViewModePreferences with default property values set for the specified view mode.