Svg.Editor.Svg packages the SVG document mutation and resource-management services used by the editor stack.
dotnet add package Svg.Editor.Svg
| Type | Role |
|---|---|
SvgDocumentService |
Open from file or stream, save, round-trip XML, export png/pdf/xps |
PropertiesService |
Build editable property-entry collections and apply values back to an element |
LayerService |
Load and mutate layer hierarchy |
PatternService |
Enumerate and add patterns |
BrushService |
Enumerate brush profiles and swatches |
SymbolService |
Enumerate and add reusable symbols |
AppearanceService |
Load and update style entries |
ToolService |
Create and update editor-created elements |
Svg.Editor.Svg.Models contains the reusable data classes behind the property inspector and resource browser:
PropertyEntryGradientStopsEntryGradientMeshEntryStrokeProfileEntryLayerEntryPatternEntryBrushEntrySwatchEntrySymbolEntryStyleEntryAppearanceLayerusing Svg.Editor.Svg;
var documentService = new SvgDocumentService();
var layerService = new LayerService();
var propertiesService = new PropertiesService();
var document = documentService.Open("Assets/__tiger.svg");
layerService.Load(document);
if (document?.Children.Count > 0 && document.Children[0] is Svg.SvgElement element)
{
propertiesService.LoadProperties(element);
propertiesService.ApplyAll(element);
}
AvalonDraw originally carried these services in the sample app. Extracting them into Svg.Editor.Svg makes the property editor, layer browser, and resource browser reusable without taking the default Avalonia workspace.