Methode oder Operation nicht implementiert Fehler beim Binden

Derzeit entwickle ich ein Visual Studio-Plugin (VSPackage), mit dem sich Anrufbeziehungen endlich visualisieren lassen. Um sie darzustellen, möchte ich das verwendenGraph # Bibliothek Hiermit wird der Graph verwaltet (Vermeidung von überlappenden Kanten usw.). Leider erhalte ich zur Laufzeit in meiner XAML folgende Fehlermeldung:

XamlParseException: Die Methode oder Operation ist nicht implementiert.

Der Fehler erscheint auf der<graph:CallRelationGraphLayout Graph="{Binding RelationGraph}"/> Etikett.

<UserControl x:Class="Biocoder.InteractiveExploration.View.ExplorationControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
         xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"
         xmlns:graph="clr-namespace:Biocoder.InteractiveExploration.Graph"
         xmlns:viewmodels="clr-namespace:Biocoder.InteractiveExploration.ViewModel"
         xmlns:controls="clr-namespace:Biocoder.InteractiveExploration.Controls" mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">



<UserControl.DataContext>
    <viewmodels:ExplorationToolViewModel/>
</UserControl.DataContext>

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <zoom:ZoomControl Grid.Row="1"
                      Zoom="0.2"
                      ZoomBoxOpacity="0.5"
                      Background="Yellow">

        <graph:CallRelationGraphLayout Graph="{Binding RelationGraph}"/>

    </zoom:ZoomControl>

</Grid>

</UserControl>

Ich habe auch eigene Vertex-, Edge- und Graph-Layout-Klassen erstellt. Mein Diagramm sollte schließlich die Aufrufbeziehungen (Kanten) zwischen Methoden (Eckpunkten) darstellen.

MethodVertex.cs

public class MethodVertex
{
    public string ID { get; private set; }
    public bool IsMale { get; private set; }

    public MethodVertex(string id, bool isMale)
    {
        ID = id;
        IsMale = isMale;
    }

    public override string ToString()
    {
        return string.Format("{0}-{1}", ID, IsMale);
    }
}

RelationEdge.cs

public class RelationEdge : Edge<MethodVertex>
{
    public string Id { get; private set; }

    public RelationEdge(string id, MethodVertex source, MethodVertex target)
        : base(source, target)
    {
        Id = id;
    }
}

CallRelationGraphLayout.cs

public class CallRelationGraphLayout : GraphLayout<MethodVertex, RelationEdge, CallRelationGraph>
{}

CallRelationGraph.cs

public class CallRelationGraph : BidirectionalGraph<MethodVertex, RelationEdge>
{
    public CallRelationGraph()
    {}

    public CallRelationGraph(bool allowParallelEdges)
        : base(allowParallelEdges)
    { }

    public CallRelationGraph(bool allowParallelEdges, int vertexCapacity)
        : base(allowParallelEdges, vertexCapacity)
    {}
}

In demExplorationToolViewModel Ich habe den RelationGraph wie folgt deklariert:

private CallRelationGraph _relationGraph;
public CallRelationGraph RelationGraph
{
    get { return _relationGraph; }
    set
    {
        if (value != _relationGraph)
        {
            _relationGraph = value;
            NotifyPropertyChanged("RelationGraph");
        }
    }
}

public event PropertyChangedEventHandler PropertyChanged;

public void NotifyPropertyChanged(string propertyName)
{
    if (PropertyChanged != null)
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}

Was ich vielleicht auch erwähnen sollte ist, dass ich manchmal den folgenden Fehler angezeigt habe, aber das Projekt kompiliert und läuft.

GenericArguments [1], 'Biocoder.InteractiveExploration.Graph.RelationEdge' in 'GraphSharp.Algorithms.Layout.ILayoutAlgorithm`3 [TVertex, TEdge, TGraph]' verletzt die Einschränkung des Typs 'TEdge'.

Vielleicht ist es die Ursache des Problems, aber ich habe es bisher ignoriert, seit es kompiliert wurde und ich habe es dementsprechend gemachtTutorial.

Das Seltsame ist, dass es tatsächlich in einer normalen WPF-Anwendung mit den von Graph # bereitgestellten DLLs funktioniert. Wenn ich die Graph-Eigenschaft auslasse, wird der Fehler nicht angezeigt. Ich schätze, es liegt an der Graph-Eigenschaft. Irgendwelche Tipps, wie man das löst?

Vielen Dank im Voraus!

Antworten auf die Frage(2)

Ihre Antwort auf die Frage