Set up control layout

This information applies to both the WPF and Silverlight Designers. In the WPF Designer, some .NET Winforms controls (and controls written for other technologies) have the same names, but have different properties, methods, and events exposed than their WPF counterparts.

Before you begin

Adding controls with a deliberate design in mind is the recommended approach. However, if multiple controls already exist in the designer, and they must be moved into a layout control, follow the steps below. This procedure uses the grid control with other existing controls as an example.

Procedure

  1. Add a layout control, such as a grid.
    Note: Some controls allow only a single child to be added. Add a control that allows multiple children (such as Grid, Canvas, Dock Panel, Stack Panel).
  2. In the designer, select the controls you want to add to the layout control, and then right-click and select Cut.
  3. In the Document Tree, select the layout control added in step 1, and then right-click and select Edit Layer.
  4. In the designer, right-click the layout control, and then select Paste.
    Note: If the controls are displayed in the Document Tree but not in the designer, then in the Document Tree, select each control and set its Margin property to 0 to have them appear in the designer.
  5. Save the form or user display.
    Click Save on the...To save...
    toolbarlocally for WPF forms; to the server for Silverlight forms
    title barto the server for WPF forms