Controls in inheritance
This section introduces few types of controls, please check chapter Customizing Controls to see the details.
Control
Control
is the minimal control for avalonia, the base of any control.
cs
public class Control : InputElement, IDataTemplateHost, INamed, IVisualBrushInitialize, ISetterValue
{
// ...
}
1
2
3
4
2
3
4
TemplatedControl
cs
public class ContentControl : TemplatedControl, IContentControl, IContentPresenterHost
{
// ...
}
1
2
3
4
2
3
4
UserControl
cs
public class UserControl : ContentControl
{
}
[TemplatePart("PART_ContentPresenter", typeof(ContentPresenter))]
public class ContentControl : TemplatedControl, IContentControl, IContentPresenterHost
{
// ...
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
INFO
UserControl
is TemplatedControl
with a default template.