Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP portrait mode for kiosk desktop app?

Tags:

uwp

Evaluating UWP for a Windows desktop app which must run in portrait mode for kiosk hardware. This seem to be a problem for UWP as desktop apps apparently assume landscape... any workarounds or is this just the wrong technology?

Is it possible to extend the list of target devices available in the design view?

like image 456
ficelles Avatar asked Sep 25 '17 11:09

ficelles


People also ask

Does Windows 11 support kiosk mode?

Locally, in Settings: The Set up a kiosk (previously named Set up assigned access) option in Settings is a quick and easy method to set up a single device as a kiosk for a local standard user account. This option supports: Windows 10 Pro, Enterprise, and Education. Windows 11.

How do I turn on kiosk mode?

To enable kiosk mode on your Android devices, Navigate to the Manage Tab and select the Devices/Device Groups/Users/User Groups for which kiosk mode is to be enabled. Click on Actions and select Enable Kiosk Mode.

What is multi-app kiosk mode?

With the multi-app kiosk mode, you can allow device users to access the device home screen, device settings, and any number of preselected apps.

Does Windows 10 home have kiosk mode?

Kiosk Mode using Windows 10 HomeMicrosoft has recently introduced a new Kiosk Mode feature in Windows 10. At first glance, this feature seems appealing as it incorporates the ability to run a single app in a locked down state.


1 Answers

I see a lot of sub sections to your question, do let me know if I've missed out something. Below are the sections:

Getting a forced portrait mode in designer:

So in-case you have a desirable screen height and width what you can do are:

  1. Select the device from the designer's device list that matches the pixel ratio and scale. (ignore the height and width).
  2. Now that you have a rough estimate of your designer, now you need to set it to your required size. To do so, in your <Page> tag of the xaml add the below declarations along with the namespace declarations.

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="500"
d:DesignWidth="300"

The above code would set your designer to the size you want and the scale and aspect ratio is set from the device that you had picked. And you can design for the size your hardware as you know the size of the deployed machine won't change.

Making the app run in Forced Portrait mode:

Well the UWP apps are meant to be adaptive which is kinda the best part about them, make once and deploy to a wide variety of your machines.

That being said, refer to this section only if you have a case scenario where in your app can be deployed to a landscape mode hardware and you want your app to still be in portrait mode. If so, then there are two ways you can go about it.

  1. Use MaxHeight and MaxWidth of your root grid or any parent (except for page) to set it to what you want so that even if the app is running fullscreen, your content will be aligned vertically center and won't go more than what you've set and the remaining window would be filled with the background that you've set.
  2. You can also set the app size while starting and then listen to the size changed event of your app, so that each time the size is changed and it falls off from the portrait mode, your set it back to portrait mode.

I am writing up a quick demo app for your better understanding. I'll add the link in a while.


Personally I think, a UWP app is best suited for your use case, as you have no idea what would be size of your deployment screen and you can actually leverage the adaptive layout of UWP, to ship your app to different vendors

like image 119
iam.Carrot Avatar answered Oct 17 '22 07:10

iam.Carrot