WPF Layouts - Windows Presentation Foundation(WPF)

What is WPF Layouts?

The layout of controls is very essential and critical for application usability. It is used to set up a group of GUI elements in your application. There is certain important equipment to consider while selecting layout panels −

  • Positions of the child elements
  • Sizes of the child elements
  • Layering of overlapping child elements on top of each other

Fixed pixel agreement of controls doesn’t work when the application is to be seed on different screen resolution. XAML provide a rich set of built-in layout panels to arrange GUI fundamentals in an appropriate way. Some of the most normally used and popular layout panels are as follows −

Sr. No. Panels & Description
1 Stack Panel
Stack panel is a simple and useful layout panel in XAML. In stack panel, child elements can be arranged in a single line, either horizontally or vertically, based on the orientation property.
2 Wrap Panel
In WrapPanel, child elements are positioned in sequential order, from left to right or from top to bottom based on the orientation property.
3 Dock Panel
DockPanel defines an area to arrange child elements relative to each other, either horizontally or vertically. With DockPanel you can easily dock child elements to top, bottom, right, left and center using theDockproperty.
4 Canvas Panel
Canvas panel is the basic layout panel in which the child elements can be positioned explicitly using coordinates that are relative to theCanvasany side such as left, right, top and bottom.
5 Grid Panel
A Grid Panel provides a flexible area which consists of rows and columns. In a Grid, child elements can be arranged in tabular form.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Windows Presentation Foundation(WPF) Topics