1
Vote

NullRerefenceException while initializing GraphLayout.Graph

description

I'm trying to use GraphvizNet.WPF.
In my DataContext i have a Property which returns a valid Graph.
I use this Property in my xaml-File:
<graphvizWpf:GraphLayout Graph="{Binding Graph}" Engine="Circo" UseContentPresenterForAllElements="True" />
Xaml-Designer annotates on Graph-Attribute and his bindiging:
"Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."
At runtime i get a NullReferenceException after InitializeCompomponetnts. Here is the Stacktrace:
" bei Graphviz4Net.WPF.GraphLayout.OnPropertyGraphChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) in C:\projects\graphviz4net\src\Graphviz4Net.WPF\GraphLayout.cs:Zeile 166.
bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
bei System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
bei System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
bei System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
bei System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
bei System.Xaml.XamlObjectWriter.WriteEndMember()
bei System.Xaml.XamlWriter.WriteNode(XamlReader reader)
bei System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
bei System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
bei System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
bei System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
bei System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
bei GraphViz4NetWpfApp.MainWindow.InitializeComponent() in C:\Users\janse\OneDrive\Dokumente\Visual Studio 2017\Projects\GraphViz4NetWpfApp\GraphViz4NetWpfApp\MainWindow.xaml:Zeile 1.
bei GraphViz4NetWpfApp.MainWindow..ctor() in C:\Users\janse\OneDrive\Dokumente\Visual Studio 2017\Projects\GraphViz4NetWpfApp\GraphViz4NetWpfApp\MainWindow.xaml.cs:Zeile 24. "

comments