ReSharper highlights classes, fields, properties, events, etc. with different colors,
so that they can be distinguished easily.
You can establish a custom color scheme. For more information, see Configuring Syntax Highlighting Fonts and Colors.
ReSharper detects various problems in XAML files, such as unresolved symbols, incorrect document
structure, unused import directives, etc. Whenever a problem is encountered, ReSharper highlights it and
displays some description in a tooltip. For more information about ways to find out why the code is
highlighted, see Finding Out What is Wrong with Your Code.
In the example below, ReSharper warns that the namespace alias is not used inside the current file and highlights it in grey:
In the example below, ReSharper highlights a problem with resolving a method inside an event subscription:
ReSharper does not only analyze errors in the current XAML file, but also inspects all files in the whole solution and shows the results of the analysis in the Errors in Solution window. It takes dependencies between files into account and updates the results when you change code.
For more information, see Solution-Wide Analysis.
ReSharper highlights color usages with corresponding color and shows additional information on the tooltip. You can also define a color using the palette. For more information, see Color Assistance.
ReSharper provides a couple of useful features that can save your efforts on typing. So you write more code with less keystrokes.
- synchronous tag editing - any change of the opening tag is simultaneously applied to the closing tag and vice versa
- smart slash - as soon as you type the slash at the end of an opening tag, the tag is automatically converted to the empty one
ReSharper provides a full set of code completion features as well. So you can complete tags:
And attributes in XAML:
Moreover, ReSharper suggests appropriate symbols and actions depending on the context:
Also, you can complete closing tags. ReSharper provides the list of tags that are not closed at the current caret position.
Examples of context actions
Convert attribute to nested element
If you want to convert an attribute to a nested element, use this context action.
After applying this context action, the attribute is converted to a child tag with the same value, so that you can provide a more complex value for the property.
Convert tag to an attribute
If the value of a property is simple, there is no need to have it in a separate tag, so you can convert it to an attribute using this context action.
After applying this context action, the tag is converted to the attribute.
Examples of quick-fixes
Make field private
To change visibility of a field declared in XAML, use the appropriate quick-fix.
After applying the quick-fix, the value of FieldModifier is changed to private.
Remove redundant namespace alias
To remove a redundant namespace alias, use the appropriate quick-fix.
After applying the quick-fix, the namespace alias directive is removed.
Remove type qualifier
When the type, to which the style should be applied, is specified in the TargetType attribute, there is no need to add a qualifier for each property of the Button class. ReSharper detects such cases and offers the quick-fix.