0
Under review
Series.Points showing returning an empty list when databound?
I've updated to the latest version of Oxyplot and seem to have a regression on the ScatterSeries<T> class.
I've written an extension method for a scatter series in "multiple selection" mode that allows to select all the points that return "true" at a specific function passed in parameter.
public static void SelectAll<T>(this ScatterSeries<T> series, Func<T, bool> func) where T : ScatterPoint, new()
{
it was working fine before the update, but now I see that the "Points" property return an empty list. Looking at the code, I see that there is a protected property "ItemsSourcePoints" that has the point list, but the "Points" property doesn't use it.
Is there a way to get the actual points? Is this by design or a bug?
Thanks.
I've written an extension method for a scatter series in "multiple selection" mode that allows to select all the points that return "true" at a specific function passed in parameter.
public static void SelectAll<T>(this ScatterSeries<T> series, Func<T, bool> func) where T : ScatterPoint, new()
{
foreach (var dataPoint in series.Points.Where(func))
{
{
series.SelectItem(series.Points.IndexOf(dataPoint));
}
}it was working fine before the update, but now I see that the "Points" property return an empty list. Looking at the code, I see that there is a protected property "ItemsSourcePoints" that has the point list, but the "Points" property doesn't use it.
Is there a way to get the actual points? Is this by design or a bug?
Thanks.
Служба підтримки клієнтів працює на UserEcho
ActualPointsproperty to public. But this property should really only be exposed as a readonly collection or anIEnumerable<T>... The current implementation is aList<T>for performance reasons. Should we add another property or method that returns the actual points asIEnumerable<T>?ScatterSeries<T>, I suggest renaming the currentActualPointsto e.g.ActualPointsListand create a newActualPointsproperty:/// <summary> /// Gets the actual points. /// </summary> /// <value> /// A read-only list of points. /// </value> public System.Collections.ObjectModel.ReadOnlyCollection<T> ActualPoints { get { return new System.Collections.ObjectModel.ReadOnlyCollection<T>(this.ActualPointsList); } } /// <summary> /// Gets the list of points that should be rendered. /// </summary> /// <value>A list of <see cref="DataPoint" />.</value> protected List<T> ActualPointsList { get { return this.ItemsSource != null ? this.ItemsSourcePoints : this.points; } }Will this work?