One could create a control by starting from a container control (like panel) and add other existing controls (like buttons, textbox, etc) on it. But in some cases, there are no such suitable primitive controls and one has to draw things from scratch.
Avalonia UI's Visual Studio extension has a UserControl
template, and it seems that it allows adding existing controls using XAML, which is the former case of the previous paragraph. But how to draw from scratch? Where is WinForm's OnPaint()
equivalent or WPF's OnRender()
equivalent? Is there any example of creating a control from scratch in Avalonia UI?
or WPF's OnRender() equivalent
It's called Render
, the name is pretty much the only difference, DrawingContext
's API closely resembles WPF one.