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; } }