Notepad.Avalonia
0.2.2
See the version list below for details.
dotnet add package Notepad.Avalonia --version 0.2.2
NuGet\Install-Package Notepad.Avalonia -Version 0.2.2
<PackageReference Include="Notepad.Avalonia" Version="0.2.2" />
<PackageVersion Include="Notepad.Avalonia" Version="0.2.2" />
<PackageReference Include="Notepad.Avalonia" />
paket add Notepad.Avalonia --version 0.2.2
#r "nuget: Notepad.Avalonia, 0.2.2"
#:package Notepad.Avalonia@0.2.2
#addin nuget:?package=Notepad.Avalonia&version=0.2.2
#tool nuget:?package=Notepad.Avalonia&version=0.2.2
Notepad.Avalonia
Two Avalonia UI controls for a single markdown note:
NoteEditor— editable source view with inline image pasting.MarkdownViewer— read-only rendered view with full markdown support, free text selection and copy.
Features
NoteEditor
- Markdown text editing for a single note
- Inline image support (paste from clipboard or programmatic insert)
- Full undo/redo with intelligent coalescing
- Text selection (single and multi-line)
- Clipboard integration (text + images)
- Text wrapping
- Light/Dark theme support
- MVVM-ready via
MarkdownTextproperty binding - Optimized for large documents (FormattedText caching, incremental layout, viewport culling)
MarkdownViewer
Renders markdown instead of showing its source. Read-only, but every rendered character can be selected and copied.
- Blocks: ATX and setext headings, paragraphs, thematic breaks, fenced and indented code blocks, nested blockquotes, nested ordered/unordered/task lists, GFM pipe tables (with column alignment)
- Inline:
**bold**,*italic*,***both***,~~strikethrough~~,`code`, links (inline, reference and autolinks), images, hard line breaks, backslash escapes and HTML entities - Selection: drag, Shift+click, double-click (word), triple-click (line),
Ctrl+A, auto-scroll while dragging past the edge. The selection is dropped on lost focus (like Avalonia'sTextBox); setClearSelectionOnLostFocus="False"to keep it — it is then drawn withInactiveSelectionBrush - Copy:
Ctrl+C/ context menu — copies the rendered text, not the markup - Links:
LinkClickedevent, opens http/https/mailto in the browser by default - Built-in scrollbar with viewport virtualization and light/dark themes
Quick Start
var editor = new NoteEditor
{
DefaultFont = new FontFamily("Segoe UI"),
DefaultFontSize = 15,
MarkdownText = "Hello world\nSecond line with "
};
var viewer = new MarkdownViewer
{
DefaultFontSize = 15,
MarkdownText = "# Title\n\nSome **bold** text and a [link](https://example.com)."
};
viewer.SelectAll();
var text = viewer.SelectedText; // rendered text, without the markup
Give the viewer a finite height (a DockPanel/Grid cell); like NoteEditor it
scrolls its own content, so do not wrap it in a ScrollViewer.
If you do place viewers inside an outer scroll area (for example a list of notes),
each one reports its full content height and renders every block — you lose the
built-in scrollbar and virtualization, but selection still behaves correctly:
clicking to select does not make the outer ScrollViewer jump, while Tab
navigation still scrolls the control into view.
MVVM Usage
<notepad:NoteEditor MarkdownText="{Binding MarkdownText}"
Images="{Binding Images}" />
<notepad:MarkdownViewer MarkdownText="{Binding MarkdownText}"
Images="{Binding Images}" />
public class MyViewModel : INotifyPropertyChanged
{
public string? MarkdownText { get; set; }
public ObservableCollection<ImageEntry> Images { get; } = new();
}
Installation
dotnet add package Notepad.Avalonia
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Avalonia (>= 12.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.