Поделиться через


How to: Change XAML View Settings

You can change the appearance and behavior of the XAML view in the WPF Designer for Visual Studio.

Changing XAML Syntax Highlighting Colors

You can change the foreground and background colors of elements and attributes displayed in XAML view.

To change XAML syntax highlighting colors

  1. From the Tools menu, select Options.

  2. In the Options dialog box, expand the Environment item.

  3. Select the Fonts and Colors item.

    The font and color options appear.

  4. In the Display items list box, find the entries which have the XAML prefix.

  5. Select the XAML language element which you want to change to a different color.

  6. Set the Item foreground and Item background values to the colors you want to display in XAML view. You can also select the Bold check box if you want the XAML language element to appear in bold face.

    Note

    Changes to font style apply to all of the XAML markup.

Changing XAML Auto-formatting Options

XAML view provides an auto-formatting feature, which enables uniform spacing and line break structure for XAML markup. To auto-format your XAML markup, press CTRL+KD when XAML view is open.

To change XAML auto-formatting options

  1. From the Tools menu, select Options.

  2. In the Options dialog box, expand the Text Editor item.

  3. Expand XAML.

  4. Expand Formatting.

  5. Under Formatting, select General or Spacing.

    The formatting options appear.

  6. Set the formatting options according to your preferences. For more information, see Formatting, XAML, Text Editor, Options Dialog Box.

See Also

Other Resources

XAML and Code in the WPF Designer

XAML and Code Walkthroughs

XAML in WPF