Note that there are some explanatory texts on larger screens.

plurals
  1. POMethod or operation not implemented error on Binding
    primarykey
    data
    text
    <p>I'm currently developing a Visual Studio plugin (VSPackage) which finally should be able to visualize call relations. In order to represent them I want to use the <a href="http://graphsharp.codeplex.com/">Graph# library</a> which manages the graph (avoiding overlapping edges etc.). Unfortunately I get the following error message at runtime in my XAML:</p> <p><strong>XamlParseException: The method or operation is not implemented.</strong></p> <p>The error pops up on the <code>&lt;graph:CallRelationGraphLayout Graph="{Binding RelationGraph}"/&gt;</code> tag.</p> <pre class="lang-xml prettyprint-override"><code>&lt;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"&gt; &lt;UserControl.DataContext&gt; &lt;viewmodels:ExplorationToolViewModel/&gt; &lt;/UserControl.DataContext&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="*"/&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;zoom:ZoomControl Grid.Row="1" Zoom="0.2" ZoomBoxOpacity="0.5" Background="Yellow"&gt; &lt;graph:CallRelationGraphLayout Graph="{Binding RelationGraph}"/&gt; &lt;/zoom:ZoomControl&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre> <p>I also created own vertex, edge and graph layout classes. My graph should finally represent call relations (edges) between methods (vertices).</p> <p><strong>MethodVertex.cs</strong></p> <pre class="lang-cs prettyprint-override"><code>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); } } </code></pre> <p><strong>RelationEdge.cs</strong></p> <pre class="lang-cs prettyprint-override"><code>public class RelationEdge : Edge&lt;MethodVertex&gt; { public string Id { get; private set; } public RelationEdge(string id, MethodVertex source, MethodVertex target) : base(source, target) { Id = id; } } </code></pre> <p><strong>CallRelationGraphLayout.cs</strong></p> <pre class="lang-cs prettyprint-override"><code>public class CallRelationGraphLayout : GraphLayout&lt;MethodVertex, RelationEdge, CallRelationGraph&gt; {} </code></pre> <p><strong>CallRelationGraph.cs</strong></p> <pre class="lang-cs prettyprint-override"><code>public class CallRelationGraph : BidirectionalGraph&lt;MethodVertex, RelationEdge&gt; { public CallRelationGraph() {} public CallRelationGraph(bool allowParallelEdges) : base(allowParallelEdges) { } public CallRelationGraph(bool allowParallelEdges, int vertexCapacity) : base(allowParallelEdges, vertexCapacity) {} } </code></pre> <p>In the <strong>ExplorationToolViewModel</strong> I declared the RelationGraph as follows:</p> <pre class="lang-cs prettyprint-override"><code>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)); } </code></pre> <p>What I maybe also should mention is that I have the following error displayed sometimes but the project compiles and runs. </p> <p><em>GenericArguments[1 ], 'Biocoder.InteractiveExploration.Graph.RelationEdge', on 'GraphSharp.Algorithms.Layout.ILayoutAlgorithm`3[TVertex,TEdge,TGraph]' violates the constraint of type 'TEdge'.</em></p> <p>Maybe its the source of the problem but I ignored it so far since it compiled and I did it corresponding to this <a href="http://sachabarbs.wordpress.com/2010/08/31/pretty-cool-graphs-in-wpf/">tutorial</a>.</p> <p>The strange thing is that it actually works in a normal WPF application using the DLLs provided by Graph#. When I leave the Graph-property out the error doesn't show up so I guess it has to do with the Graph property. Any hints about how to solve this?</p> <p>Thank you very much in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload