Avalonia has an inbuilt DevTools window which is enabled by calling the attached
AttachDevTools()method in a
Windowconstructor. The default templates have this enabled when the program is compiled in
public partial class MainWindow : Window
// in auto-generated by Avalonia.NameGenerator MainWindow.g.cs:
partial class MainWindow
public void InitializeComponent(bool loadXaml = true, bool attachDevTools = true)
To open the DevTools, press F12, or pass a different
There is a known issue when running under .NET core 2.1 that pressing F12 will cause the program to quit. In this case, either switch to .NET core 2.0 or 3.0+ or change the open gesture to something different, such as
Visual Treetabs display the controls in the window's logical and visual trees. Selecting a control will show the properties of that control in the right-hand pane where they can be edited.
Allows for quickly checking and editing properties of the control. One can also search for properties (by name or by using a regex).
Allows for inspecting and editing of common layout properties (
Padding). Control size and size constraints are also shown.
Additionally one can see all styles that could potentially match this control (by toggling
Current styles can be snap-shotted by either pressing the
Snapshotbutton or pressing
Alt+Swhile hovering over the target window. Snap-shotting means that styles panel won't update to reflect new state of the control. This is especially useful when troubleshooting problems with
Setters have a context menu that allows for quickly copying names and values to the clipboard.
The events tab can be used to track the propagation of events. Select the events to track in the left pane, and all events of that type will be shown in the center upper pane. Select one of these events to see the event route.
The console can be shown using the "View" → "Console" menu. The console implements a C# REPL which can be used to run arbitrary C# code. In a console session, the following predefined variables are available:
help: Displays a help message
e: The control currently selected in the logical or visual tree
root: The root of the visual tree