Home > Net >  Check if UWP application is running on Xbox
Check if UWP application is running on Xbox

Time:09-22

Is there any way to detect/check from C# code if the application is running on Xbox or a PC?

Something like:

if (Environment.IsXbox)
{
    // Do Xbox specif stuff
}

CodePudding user response:

Check if UWP application is running on Xbox

For this scenario, you could use SystemInformation that comes from Microsoft.Toolkit. For getting current device family. please use following code directly.

if (SystemInformation.DeviceFamily=="Windows.Xbox"){
// Do Xbox specif stuff
}
  • Related