The WPF Layout system is the fundamental change how UI are rendered.
With WinForm, elements were positioned using fixed coordinates, it is a limited system. With screen resolution, text font size and length changes, the UI was not properly render. This is often the case when you translate text from English to a language where words are longer. For example the content of a TextBlock in Japanese might be trim because the translated text is too long, so the solution was to put the size of the label in the localization DLL and change the apply the value in the source code.
WPF Layout system resolve those render issues.
When a WPF Panel need to be render, it recursively ask all his child elements, their needed size and where they want to be render. So in our previous example, the TextBlock will respond to his panel with the size needed to display the localized text. It will be up to the Panel to decide if the size is suitable, and where to render it depending on his other child.
There is 5 simple WPF Panels:
| Grid | Will arrange his child based on their row and column affiliation |
| StackPanel | Will stack his child vertically or horizontally |
| WrapPanel | Will stack his child vertically or horizontally and will “wrap” them if needed |
| DockPanel | Will dock his child on a specified side |
| Canvas | Will arrange his child using there coordinate |
You have also the possibility to create your own Panel based on the simple WPF Panels described above.
It is only a matter to mesuare and arrange the childs of your Custom Panel.
Would you like to know more? Read the article Custom Panel.
Other WPF Panels for a more complex inherited from those Panels:
- VirtualizingPanel
- TabPanel
- ToolBarPanel
- ToolBarOverflowPanel
- DataGridRowsPresenter
- DataGridCellsPanel
- SelectiveScrollingGrid
- UniformGrid
- VirtualizingStackPanel



