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

Fix UWP issues #62

Merged
merged 1 commit into from
Jun 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
}
}