Dela via


FormattingOptions Enumeration

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Flags for the XamlLanguageService.FormatSource method that control how the source is formatted.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.Xaml
Assembly:  Microsoft.Windows.Design.Markup (in Microsoft.Windows.Design.Markup.dll)

Syntax

'Declaration
<FlagsAttribute> _
Public Enumeration FormattingOptions
'Usage
Dim instance As FormattingOptions
[FlagsAttribute]
public enum FormattingOptions
[FlagsAttribute]
public enum class FormattingOptions
public enum FormattingOptions

Members

Member name Description
FormatAttributes Indicates to formats attributes. If this option is not set, the whitespace in element tags are not modified. Only whitespace between elements are modified.
SpaceBeforeSimpleTerminator Indicates that a space be inserted before the simple tags. For example <Button/> is formatted as <Button />.
NewLineBeforeAttributes Indicates that each attribute be preceded by a new line and indented to one indent level greater than the element's content. If this option is not set, each attribute is formatted to be preceded by a single space.
KeepFirstAttributesOnSameLine Indicates to keep the first attribute on the same line as the tag. Overrides NewLineBeforeAttributes for the first attribute. If this option is set, the first attribute is preceded by a single space and all others are formatted on their own line.
PreserveAttributeNewLines Indicates to preserve attribute new lines. If the attributes are not formatted on their own line (NewLineBeforeAttributes is not set) and the whitespace being replaced contains a new line, the attribute is formatted as if NewLineBeforeAttributes was set. This has the effect of ensuring attributes that begin on a new line will still be on a new line after formatting.
PreserveContentNewLines Indicates to preserve new lines in content. Otherwise, redundant new lines are removed and replaced with a single new line. PreserveContentNewLines and CollapseContentNewLines cannot be specified together.
CollapseContentNewLines Indicates to collapse new lines in content. Otherwise, redundant new lines are removed and replaced with a single new line. PreserveContentNewLines and CollapseContentNewLines cannot be specified together.

See Also

Reference

Microsoft.Xaml Namespace

Other Resources

WPF Designer Extensibility