Best Practices
-
Avoid fixed positions - use the Alignment properties in combination with Margin to position elements in a panel.
-
Avoid fixed sizes - set the Width and Height of elements to Auto whenever possible.
-
Don't abuse the canvas panel to layout elements. Use it only for vector graphics.
-
Use a StackPanel to layout buttons of a dialog.
-
Use a GridPanel to layout a static data entry form. Create a Auto sized column for the labels and a Star sized column for the TextBoxes.
-
Use an ItemControl with a grid panel in a DataTemplate to layout dynamic key value lists. Use the SharedSize feature to synchronize the label widths.
[http://wpftutorial.net/LayoutProperties.html]