Binding errors when disposing chart

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
NielsUll
Posts: 19
Joined: Thu Jan 19, 2017 8:23 am

Binding errors when disposing chart

Post by NielsUll » Thu Feb 23, 2017 5:05 pm

Hi!

We are using the semibindable library v 7, but we are getting some errors in the log when disposing the chart.

I have tried modifying the sampe ExamplePointLineSeriesXY to bind the title of the x axis to a viewmodel string.
When the m_chart.Dispose() is called (when switching to a different window), I get this error in the debug log:

Code: Select all

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Title; DataItem=null; target element is 'AxisXTitle' (HashCode=53412038); target property is 'Text' (type 'String')
The thread 0x3514 has exited with code 259 (0x103).
What is causing this?
In our real application, we have many, many lines of this, since we have many bindings. Is there an easy fix?

We are a bit new at wpf, so it might be something really stupid we are missing.

Regards, Niels

BTW, it is a bit surprising that your discussion forum don't allow attaching .xaml and .cs files :-)
Attachments
Modified_files.zip
The modified ExamplePointLineSeriesXY.xaml and .xaml.cs demonstrating the problem
(1.72 KiB) Downloaded 479 times

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Binding errors when disposing chart

Post by ArctionKestutis » Tue Feb 28, 2017 7:35 am

Hi,

Sorry for the delay, question have been lost between other issues :oops:

Thank you for your report. It don't look like severe problem - you should be able to run application normally. This just warning, which tell about broken binding. This particular case could be removed with addition of line in Dispose() method. Please add

Code: Select all

m_chart.ViewXY.XAxes[0].Title.Text = null;
before m_chart removal.

We will investigate how we could handle this kind of situation internally in the future.

All the best,
Kestutis

NielsUll
Posts: 19
Joined: Thu Jan 19, 2017 8:23 am

Re: Binding errors when disposing chart

Post by NielsUll » Fri Mar 03, 2017 12:51 pm

OK - setting the bound properties to null would unfortunately require a lot of code (and code maintenance), since we have many bindings.
So we will see if we can live with the warnings before we start doing this.

Post Reply