Installation
To use AvaloniaEdit in your project, you need to add the NuGet package and configure the application styles.
1. Add NuGet Package
Add the Avalonia.AvaloniaEdit package to your project. If you want modern syntax highlighting support, also add AvaloniaEdit.TextMate.
<!-- In your .csproj file -->
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.6" />
<!-- Optional: For TextMate support -->
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.6" />
Note: Check NuGet for the latest versions compatible with your Avalonia version.
2. Configure Application Styles
Important: AvaloniaEdit will not render correctly (or at all) if you do not include its theme resources in your App.xaml.
Open App.xaml and add the StyleInclude for AvaloniaEdit within <Application.Styles>.
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyAvaloniaApp.App">
<Application.Styles>
<FluentTheme />
<!-- Add the AvaloniaEdit StyleInclude here -->
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
</Application.Styles>
</Application>
- Avalonia 11.x: Use
avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml. - Legacy (0.10.x): Use
avares://AvaloniaEdit/AvaloniaEdit.xaml.