Portrait screen at the beginning of Windows phone7

Source: Internet
Author: User

During the development of window phone, you can set the rotation of horizontal and vertical screens in the header of the XAML file.

Supportedorientations = "portraitorlandscape" orientation = "portrait"

Note: supportedorientations is the horizontal and vertical screen mode of the page, which is divided into three types: portraitorlandscape (landscape screen), portrait (landscape screen), and landscape (landscape screen)

Orientation is the page display mode at startup.

If you make various judgments, delegate the method in the page constructor of the CS file in the background, and then judge and complete the function in the implementation method. For example, when I perform the paging function, the default 10 data records are loaded on the portrait screen, and 5 data records are loaded on the Landscape screen by default.

 public CustomerPage()        {            InitializeComponent();            OrientationChanged += new EventHandler<OrientationChangedEventArgs>(CustomerPage_OrientationChanged);         }        void CustomerPage_OrientationChanged(object sender, OrientationChangedEventArgs e)        {            if (e.Orientation == PageOrientation.LandscapeLeft                 || e.Orientation == PageOrientation.LandscapeRight)            {                PageCount = 5;            }            else if (e.Orientation == PageOrientation.PortraitDown                 || e.Orientation == PageOrientation.PortraitUp)            {                PageCount = 10;            }        }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.