The Device.OnPlatform member function can be used in order to execute different lines of code depending on the operating system.
Device.OnPlatform(
iOS: () =>
{
// iOS code
},
Android: () =>
{
// Android code
},
WinPhone: () =>
{
// Windows code
});