Wednesday, July 4, 2018

UWP: Is there a way to find the device to which you are deploying a UWP Project?

You can find this information using the Windows.System as shown here:

Device_000

We can find the device to which the UWP is deployed using the above information.

Here is a Blank UWP Project's MainPage.xaml.

Device_0
I have a button and a text box. Button's click event finds the device information and writes to the text box using the click event shown here:

Device_00

When deployed to the machine (Windows 10 Pro Desktop), the response is as shown.

Device4.jpg

When deployed to an emulator:

The display shows the device info:


You can get the DeviceFamilyVersion as well. The code is inside the image.

On the emulator this is displayed.







No comments: