Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #62 from OpenDesignMe/master
Browse files Browse the repository at this point in the history
Fix UWP issues
  • Loading branch information
jamesmontemagno authored Jun 13, 2018
2 parents 7c8ea3d + f1c6bfe commit 8411e2a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/DeviceInfo.Plugin/DeviceInfo.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,16 @@ public Abstractions.Platform Platform
case "Windows.Mobile":
return Abstractions.Platform.WindowsPhone;
case "Windows.Desktop":
return UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Mouse
? Abstractions.Platform.Windows
: Abstractions.Platform.WindowsTablet;
try
{
return UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Mouse
? Abstractions.Platform.Windows
: Abstractions.Platform.WindowsTablet;
}
catch
{
return Abstractions.Platform.Windows;
}
case "Windows.IoT":
return Abstractions.Platform.IoT;
case "Windows.Xbox":
Expand Down Expand Up @@ -212,6 +219,6 @@ public Idiom Idiom
///
/// Source: http://igrali.com/2014/07/17/get-device-information-windows-phone-8-1-winrt/
/// </summary>
public bool IsDevice => deviceInfo.SystemProductName == "Virtual";
public bool IsDevice => deviceInfo.SystemProductName != "Virtual";
}
}

0 comments on commit 8411e2a

Please sign in to comment.