For my app I am setting it to run on the Desktop at a startup height of 480 and a width of 320.
On my Mainpage's code behind file I call the following method:
public MainPage()
{
GetDeviceFormFactorType();
}
public static DeviceFormFactorType GetDeviceFormFactorType()
{
switch (AnalyticsInfo.VersionInfo.DeviceFamily)
{
case "Windows.Mobile":
return DeviceFormFactorType.Phone;
case "Windows.Desktop":
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size { Width = 320, Height = 480 });
ApplicationView.PreferredLaunchViewSize = new Size { Height = 480, Width = 320 };
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
return DeviceFormFactorType.Desktop;
case "Windows.Tablet":
return DeviceFormFactorType.Tablet;
case "Windows.Universal":
return DeviceFormFactorType.Iot;
case "Windows.Team":
return DeviceFormFactorType.SurfaceHub;
default:
return DeviceFormFactorType.other;
}
}
public enum DeviceFormFactorType
{
Phone,
Desktop,
Tablet,
Iot,
SurfaceHub,
other
}