UserControl represents a "view" in Avalonia, which is a reusable collection of controls in a
You can create
UserControls from templates:
- Right click the folder in Solution Explorer that you'd like to add the control to
- Select the
Add -> New Itemmenu item
- In the dialog that appears, navigate to the "Avalonia" section in the category tree
- Select "UserControl (Avalonia)"
- Enter your control name under "Name"
- Click the "Add" button
UserControl usually consists of two parts: a XAML file (e.g.
MyUserControl.xaml) and a
codebehind file (e.g.
MyUserControl.xaml.cs). The codebehind defines a .NET class which
represents the control.