A few key principles when arranging elements.


  • Elements (such as controls) should not be explicitly sized. Instead, they grow to fit their content. For example, a button expands as you add more text. You can limit controls to acceptable sizes by setting a maximum and minimum size.
  • Elements do not indicate their position with screen coordinates. Instead, they are arranged by their container based on their size, order, and (optionally) other information that’s specific to the layout container. If you need to add whitespace between elements, you use the Margin property.
  • Layout containers “share” the available space among their children.They attempt to give each element its preferred size (based on its content) if the space is available. They can also distribute extra space to one or more children.
  • Layout containers can be nested.A typical user interface begins with the Grid, WPF’s most capable container, and contains other layout containers that arrange smaller groups of elements, such as captioned text boxes, items in a list, icons on a toolbar, a column of buttons, and so on.

댓글

이 블로그의 인기 게시물

Oracle NLS_DATE_FORMAT 변경

Alternative to IValueConvert, QuickConverter

Stop console process using Ctrl+C.