Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Plot when ItemsSource is collection and changes #406

Closed
MendelMonteiro opened this issue Mar 9, 2015 · 10 comments
Closed

Update Plot when ItemsSource is collection and changes #406

MendelMonteiro opened this issue Mar 9, 2015 · 10 comments

Comments

@MendelMonteiro
Copy link
Contributor

If ItemsSource implements INotifyCollectionChanged we should update the plot view when the collection changes.

@objorke
Copy link
Member

objorke commented Mar 10, 2015

Are you thinking in the portable code or WPF wrapper only? See also #136 and #407

@MendelMonteiro
Copy link
Contributor Author

I was thinking of doing it only for WPF. Do you think this pattern would fit other clients as well?

@objorke
Copy link
Member

objorke commented Mar 10, 2015

All the other platforms are using the portably model only!

@MendelMonteiro
Copy link
Contributor Author

Am I right in thinking that if we want to implement this for all the client types we would move the implementation done for WPF into the OxyPlot.Series.ItemsSeries class?

@objorke
Copy link
Member

objorke commented Mar 17, 2015

Yes, I think it could also be implemented there.

If the model should implement the observable pattern, I think it should be done everywhere, otherwise it may create a lot of confusion...

@MendelMonteiro
Copy link
Contributor Author

It's a pity but the current portability settings mean that INotifyCollectionChanged is not available in the portable project. It's not supported for .NET frameworks before 4.5 and Silverlight 5.

Have you run into this in OxyPlot before?

@objorke
Copy link
Member

objorke commented Mar 23, 2015

Right, I guess this means it will be difficult to implement this feature... I don't want to include code that cannot be part of the portable library...

@objorke objorke added hold and removed you-take-it labels Mar 23, 2015
@objorke
Copy link
Member

objorke commented Mar 24, 2015

We could add a collection changed interface in OxyPlot.dll... And a generic list class that implements the interface and supports batch add/insert/remove... E.g. an ObservableCollection<T> alternative that also contains AddRange, InsertRange and RemoveRange...

@MendelMonteiro
Copy link
Contributor Author

Interesting, it would be good to make it as explicit as possible in the API that you can use that interface. Maybe we could provide another alias property that is typed such as LiveItemsSource?

@tibel
Copy link
Contributor

tibel commented May 14, 2015

Support for INotifyCollectionChanged depends on #115.
Also consider #475.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants