Binding update adds news series to WPF Toolkit chart (instead of replacing/updating series) -
I'm currently adding a chart to my app to use the chart
class Using this MVVM, I am binding a column serial
of item source
in my chart for a property on my own vendor, here is the relevant XAML:
& lt; Charting: Chart & gt; And lieutenant; Charting: Columnist items source = "{binding score distribution.class scores}" IndependentWallUppace = "Classname" Detaptant Walletpath = "Score" /> & Lt; / Charting: Chart & gt; Property on the View MODEL:
):// NB: Voicemodel exam from Josh Smith's bindable object public class ExamResultsViewModel: BindableObject {// .. Private ScoreDistributionBallsSecurity Distribution; Public Score DistributionB-Class Scandalousization {Return Assistance Distribution; } Set {if (_scoreDistribution == value) {return; } _scoreDistribution = Value; RaisePropertyChanged ((= = ScoreDistribution); }}
However, when I update the
score distribution
property (setting it to a newscore distribution
object) To keep the chart in an extra series (based on new score distribution) as well as the original series (based on previous scores distribution).To illustrate this, here are some screenshots shown before an update (with a data point in the
ScoreDistribution.ClassScore
) and then (now Score dialog with 3 data points in class scores
Now, I know that I Could have been done in other ways (such as the original
score distribution
instead of changing the contents of the object completely), but I am not following why anybody is going wrong in its present form can help is?
I had the same problem when changing the ItemsSource of a DataPointSeries, it happened that the old data point The chart was not removed.
My work in WPF Toolkit (DataPointSeries.cs) ...
A
, because we change the archive: foreach
in the loop LoadDataPoints ()
Instead of
for (int i = OldItems.Count - 1; i> = 0; i--)
If in
change OnDataPointStateChanged ()
:
if (Data Point. Stat = = DatapointState.Heded || Datapoint.State == DatapointState.Pending Removal)
In this way the Dataport will be immediately removed.
Edit : I had to disable the Datapoint animation, even described.
Comments
Post a Comment