Dennis Larisch
Dennis Larisch

Reputation: 573

Cannot find ApplicationView in UWP

First of all im started to work with UWP today for the first time.

And i can´t seem to find the "ApplicationView" Setting im trying to add the following snippet to my MainPage constructor:

public MainPage()
{
    this.InitializeComponent();

    ApplicationView.PreferredLaunchViewSize = new Size(480, 800);
    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

    // if you want not to have any window smaller than this size...
    ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(480, 800));
}

this is what Visual Studio 2017 tells me

Upvotes: 2

Views: 1946

Answers (1)

Vincent
Vincent

Reputation: 3746

You just need to add the needed namespace : Windows.UI.ViewManagement at the top of you file.

using Windows.UI.ViewManagement;

ApplicationView ìs defined in the Windows.UI.ViewManagement namespace

Upvotes: 6

Related Questions