public static class Utilities
    {
        public static bool IsInLandscape(this PhoneApplicationPage page)
        {
            return !page.IsInPortrait();
        }
        public static bool IsInPortrait(this PhoneApplicationPage page)
        {
            return page.IsInOrientation(PageOrientation.Portrait |
                PageOrientation.PortraitUp | PageOrientation.PortraitDown);
        }
        public static bool IsInOrientation(this PhoneApplicationPage page, PageOrientation testOrientation)
        {
            var orientation = page.Orientation;
            return orientation.IsOrientation(testOrientation);
        }
        public static bool IsOrientation(this PageOrientation orientation, PageOrientation testOrientation)
        {
            return (orientation & testOrientation) > 0;
        }
    }

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2021-04-21
  • 2022-01-30
  • 2021-09-03
  • 2021-06-11
  • 2021-10-09
  • 2021-08-22
猜你喜欢
  • 2021-10-17
  • 2021-08-03
  • 2022-03-05
  • 2021-10-05
  • 2022-12-23
  • 2021-09-11
  • 2022-02-28
相关资源
相似解决方案