Skip to main content

Avalonia for Visual Studio extension

The Avalonia for Visual Studio extension provides an enhanced editor and a previewer, both intended to provide a superior experience working with Avalonia XAML files in Visual Studio.

Enhanced editor​

The editor for Avalonia XAML includes the following capabilities:

  • IntelliSense while typing
  • Error highlighting and fix suggestions
  • Automatic XAML namespace imports
  • Full colorization of the XAML
  • "Go To Definition" navigation
  • Hover tips
  • Automatic document formatting
  • Outlining of the document so you can collapse elements

Previewer​

The previewer allows you to see what the UI of the open file looks like, without needing to run the application.

For more information, see Previewing your UI design.

A screenshot demonstrating a test of the Avalonia XAML previewer.

Installation​

See Set Up Your IDE for installation instructions.

Settings​

Multiple options are provided to allow you to configure the way the editor and previewer behave.

These can be accessed by selecting Options from the Tools menu inside Visual Studio.

A screenshot showing the options dialog.

SettingDescriptionOptions
Color SchemeControls how the AXAML file contents are colored. Requires a paid account to change.
  • Roslyn (Default): Colors are based on equivalent C# classifications.
  • XML: Colors are assigned as if a regular XML document.
Default Document ViewWhat is displayed when a document is opened.
  • Split (Default): Both the code and the previewer.
  • Design: Previewer only.
  • Source: Source code only.
Split OrientationWhether to split the orientation horizontally or vertically.
  • Horizontal (Default): Editor and previewer are displayed side by side.
  • Vertical: Editor and previewer are displayed one above the other.
SwappedSwitch the positions of the editor and previewer in Split mode.Checked: Positions are swapped.
Default Zoom LevelHow the window content is sized.
  • 50%, 75%, 100% (Default), 125%, 150%, 200%
  • Fit to Width: Scale the preview to the available width.
  • Fit All: Fill the entire previewer.
Minimum Log VerbosityMinimum LogLevel for the extension to produce log output.Trace, Debug, Information (Default), Warning, Error, Critical, None
Telemetry EnabledIf basic usage telemetry should be reported. Requires a paid account to change.
  • Checked (Default): Telemetry is reported.
  • Unchecked: Telemetry is not reported.
Experimental PreviewerUse the new version of the previewer. Recommended for most users.
  • Checked (Default): New previewer version
  • Unchecked: Older previewer version
Signed in statusIf signed in, shows the name of the account.Link to sign in or out.

See also​