DEV Community

Cover image for How to Use AvaloniaUI Developer Tools
Ingvar
Ingvar

Posted on

10 1

How to Use AvaloniaUI Developer Tools

Hello, in this post I will briefly explain how to install and use developer tools in your AvaloniaUI project. As always, I will use my app Camelot as working example.

What is developer tools window?

Developer tools window is similar feature to Chrome developer console. It allows you to observe tree of elements, their styles and positions, including margins/paddings etc. Also it has ability to log UI events and even to show FPS!

Alt Text

How to add it

Add following lines of code inside your main window code behind class inside constructor:



#if DEBUG
    this.AttachDevTools();
#endif


Enter fullscreen mode Exit fullscreen mode

Example of code

Usage

Open developer tools window using F12.

Watch visual tree and edit controls parameters:

Alt Text

Watch events:

image

Check FPS:
image

Highlight elements in tree:

image

Official documentation

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (1)

Collapse
 
hanuman profile image
Etienne Charland

Thank you for taking the time to write such well-written documentation! Some of the links to the official doc are broken though.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay