public sealed class DiagramViewModel : ViewModelBase
{
public Diagram MyGraph { get; set; } = new();
}
But I get the following error when I try to build:
Error AVLN:0004 Avalonia: Unable to find suitable setter or adder for property Diagram of type Northwoods.GoDiagram.Avalonia:Northwoods.Go.Avalonia.DiagramControl for argument Avalonia.Markup.Xaml:Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindingExtension, available setter parameter lists are:
Northwoods.Go.Diagram
Northwoods.Go.Part
Northwoods.Go.Part Line 12, position 9.
Not at this time. GoDiagram was designed to support multiple .NET platforms, so for compatibility between them, we manage the instantiation of the Diagram class internally.
I feel dumb asking this but is it possible to bind a Diagram to a view model property, rather than using the code-behind?
I have the control:
and my view model:
But I get the following error when I try to build: