The Basic Layout Controls in WP7 - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, June 4, 2011

The Basic Layout Controls in WP7

As you are probably aware, pages in Windows Phone 7/WP7 are created using XAML (eXtensible Application Markup Language). Unlike other mobile platforms, the highly structured nature of XAML includes several different controls that provide different layout methods. This is somewhat of a departure from other platforms where controls are placed on screen/page using an absolute position only. Absolute positioning does have its merits; however, as soon as you need to allow your application to run on multiple screen sizes you will need to make changes to your app to support the different screen size. Once you become familiar with other schemes of layout you should find yourself needing absolute positioning less and less. Listed below are the basic layout controls available for WP7.

Canvas

The first layout method that can be used is the Canvas, which provides the ability to perform absolute layouts. Yes, WP7 does provide support for absolute layouts; however, it really isn't recommended for the reasons described above. Nonetheless, it is available and provides you with the ability to perform X, Y positioning of controls within the Canvas. The Canvas is good to get a general idea of how you want your screen to look; then it is a good idea to go back and recreate using the other layout controls listed below. The image below shows a simple layout with two controls inside the canvas as well as the corresponding XAML for the image.

Read More....

No comments:

Post a Comment