Jaime Rodriguez | Microsoft Principal Technical Evangelist Laurent Bugnion | IdentityMine Senior Director XAML Deep Dive for Windows & Windows Phone Apps Jump Start
Course Topics XAML Deep Dive for Windows & Windows Phone Apps Jump Start 01 | Intro to XAML 02 | XAML UI Elements 03 | Controls 04 | Panels & Layout 05 | Data Binding 06 | MVVM 07 | Windows Personality Controls
Module 4 | Panels & Layout
Panel class Responsible for layout of its’ children public class Panel : FrameworkElement { protected Panel(); public Brush Background { get; set; } public UIElementCollection Children { get; } public TransitionCollection ChildrenTransitions { get; set; } public bool IsItemsHost { get; } // from FrameworkElement protected virtual Size ArrangeOverride(Size finalSize); protected virtual Size MeasureOverride(Size availableSize); }
Panels Core Framework panels: Canvas StackPanel Grid VirtualizingStackPanel Platform specific Phone: Windows: ItemsWrapGrid, VariableSizedWrapGrid,
Canvas Top, Left Top, Right Bottom, Left Bottom, Right X Y Absolute Positioning
StackPanel Stacks child elements together Orientation: Vertical Horizontal
Grid Row = 0 Row = 1 Row = 2 Row = 3 Column = 0 Column = 1 Column = 2 RowSpan = 3 ColumnSpan = 2
Properties affecting layout Width/Height HorizontalAlignment/VerticalAlignment Margin Padding Visibility
Alignment Determines position and stretch for an element HorizontalAlignment Left, Center, Right, Stretch VerticalAlignment Top, Center, Bottom, Stretch
Margin Space outside edges of an element
Padding Space inside edges of an element
Custom panels
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.