Autogenerated by MFractor v3.2.0

Collapse Attributes Onto Same Line

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.collapse_attributes_onto_same_line

The Collapse Attributes code action will fold all attributes onto the same line for the XAML node under the cursor.

Using the Collapse Attributes code action

Collapse Node

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.collapse_node_closing_tag

When a Xaml node has a closing tag and no children (eg: <MyNode> </MyNode>), this refactoring allows the developer to remove the closing tag to make the node self-closing. For example, when applied to the node <MyNode> ... </MyNode>, the closing tag </MyNode> is removed and the element becomes self closing like so: <MyNode/>.

Expand Attributes Onto Separate Lines

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.expand_attributes_onto_new_lines

The Expand Attributes code action move all attributes onto seperate lines for the XAML node under the cursor.

Using the Expand Attributes code action

Expand Node

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.expand_node_with_closing_tag

When a Xaml node is self-closing (EG <MyNode/>), this organise refactoring allows a developer to generate a closing tag for the node. For example, the node <MyNode/> would become <MyNode> ... </MyNode> after applying this refactoring.

Format Xaml Document

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.format_document

Applies the xml formatting policy to the entire document. It will correctly indent nodes, sort attributes, align attributes under the parent node.

Configurable Properties

Name Type Defaults To Description
AttributesOnSeparateLines System.Boolean False Should attributes be placed onto separate lines?

Uses:

Remove Unused Namespaces

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.remove_unused_namespaces

When a xaml node has unused xml namespace declarations, this code action will remove all unused namespaces.

Configurable Properties

Name Type Defaults To Description
ShouldSort System.Boolean True If the attributes for this node should be sorted when the unused namespaces are removed

Uses:

Sort Xaml Attributes

Professional Only

Configuration Id: com.mfractor.code_actions.xaml.sort_attributes

This Sort Attribute code actions sorts the attributes for a Xaml node and then recreates the xaml node based on the IDE's xml formatting policy.

Using the sort attributes code action

MFractor uses the following rules when sorting:

  • Attributes that declare an xml namespace are ordered first, sorted alphabetically ascending. For example xmlns:forms=\"http://xamarin.com/schemas/2014/forms\" will appear before xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\".
  • Attributes that belong to the Microsoft Xaml schema http://schemas.microsoft.com/winfx/2009/xaml are ordered next. For example, the x:Class or x:Name declaration.
  • Attributes belonging to the default namespace are ordered next, sorted alphabetically ascending.
  • Attributes belonging to the other namespaces are then ordered next, sorted by namespace ascending and then by attribute name ascending.

Uses: