This topic provides an overview of the main CodeRush features for XAML.
Place the caret in a resource dictionary source or image source and press F12 to open the dictionary or image in XAML code.
CodeRush can navigate to an identifier declaration (in markup or code behind) from any reference in a XAML file: tag, markup extension, etc.
Place the caret in an identifier and press F12.
You can jump to a named element from any place in your XAML code.
Invoke the Jump To window with the Ctrl + Alt + N shortcut.
Choose XAML Element in the Jump To window.
Select the element from the "Available locations" list.
For more information on CodeRush navigation features, see Navigation and Search Tools.
The following example shows how to expand the "g3x2" template with the Tab key to create a grid with three columns and two rows:
CodeRush also provides binding templates. The example below shows how to expand the "ben" template to bind a text block to the ComboBox SelectedItem.Content property.
For more information on templates, see Code Templates.
XAML markup has deep and complex structure that can be difficult to understand. CodeRush can format any XAML document to improve code readability and layout.
After execution, each tag's indentation corresponds to its folding level.
This code formatter collapses the attributes of a XAML tag into a single line or breaks them apart.
For more information on code formatters, see Code Formatters.
You can extract an attribute from a XAML tag and make it a child element. You can also perform the reverse operation — inline a child element as an attribute of the parent tag.
For more information on refactorings, see Refactoring Assistance.
You can paste a piece of markup into your file and call the Import All Types code provider. This provider declares all namespace references used in the XAML file.
For more information on code providers, see Code Providers.
To enable visualization features, use the Quick Setup options page.
The Show Color feature adds a color preview to all colors you use in XAML code.
You can use the CodeRush Color Picker to edit a color visually. Click a preview stripe to invoke this editor.
This feature supplements your code with lines that highlight XAML markup structure.
CodeRush displays the region name on the closing tag.
For more information on CodeRush visualization features, see Visualization Tools.
You can surround the selected markup code with a tag or region.