Created
May 16, 2017 18:51
-
-
Save rafaelrmou/ca30d8a7fb782c9a421ec366515a5f7a to your computer and use it in GitHub Desktop.
DeviceHelper.cs for Xamarin.Forms OnPlatform deprecated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DeviceHelper | |
{ | |
public static T OnRuntimePlatform<T>(T t1, T t2, T t3, T t4) | |
{ | |
switch (Device.RuntimePlatform) | |
{ | |
case Device.Android: | |
return t1; | |
case Device.iOS: | |
return t2; | |
case Device.WinPhone: | |
case Device.Windows: | |
return t3; | |
default: | |
return t4; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment