Skip to content

Instantly share code, notes, and snippets.

@edewit
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save edewit/973152a07e1dfd8a4c9e to your computer and use it in GitHub Desktop.

Select an option

Save edewit/973152a07e1dfd8a4c9e to your computer and use it in GitHub Desktop.
using Windows.Foundation.Metadata;
// you used to have
#if WINDOWS_PHONE_APP
// something for hardware buttons
#endif
// now you can use Metadata to make it a runtime check
if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
HardwareButtons.BackButtonPressed += BackButtonHandler;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment