xamarinuwpsystem-information

Xamarin Forms - What is the current device/system type?


I was working by debug my app with a Microsoft Phone 10 when I realized "UWP is a cross windows logic", so now I'm working with my computer.

However, a question comes up in my mind :

How can you know/get information about what type of system your app is running on?

I mean by this question, by example, does my app is currently running on a phone or on a computer?

Thank for your help !


Solution

  • In PCL or SAP

    The static Device class includes several properties and methods that allow your code to deal with device differences at run time in a very simple and straightforward manner:

    You can use these two properties in if and else statements, or a switch and case block, to execute code specific to a particular platform.

    Device