Skip to content

Instantly share code, notes, and snippets.

@LanceMcCarthy
Created August 12, 2016 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LanceMcCarthy/1e0c29e0b86478f301cb1a1738cf2a92 to your computer and use it in GitHub Desktop.
Save LanceMcCarthy/1e0c29e0b86478f301cb1a1738cf2a92 to your computer and use it in GitHub Desktop.
Custom OnPlatform
public class OnTargetPlatform<T> : OnPlatform<T>
{
public T Windows { get; set; }
public static implicit operator T(OnTargetPlatform<T> onPlatform) => Device.OS == TargetPlatform.Windows ? onPlatform.Windows : (OnPlatform<T>) onPlatform;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment