avaloniauicontrol-library

Avalonia : how to create an avalonia control library


I have been looking all over the internet and I cannot find how to create a library with avalonia controls (to be used in other projects).

  1. what type of project do I need to start (in the templates I do not see anything like an avalonia (control) library (don't think it is resources dictionary, would be weird)) ?

  2. if it is just a standard library, what are the required nuget packages (currently desktop only needed) ?

  3. where do I put the compiled dlls best in the using project ?

I'm using Avalonia preview 11.4 on Windows 11.


Solution

  • You just need a normal c# class library. Then install only the Avalonia package. No need for Avalonia.Desktop or Avalonia.Mobile or anything. All types for controls are in the Avalonia nuget