Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Is live-charts could use mvvm pattern binding data and display? #27

Closed
flyaim opened this issue Oct 30, 2015 · 6 comments
Closed

Is live-charts could use mvvm pattern binding data and display? #27

flyaim opened this issue Oct 30, 2015 · 6 comments

Comments

@flyaim
Copy link

flyaim commented Oct 30, 2015

Is live-charts could use mvvm pattern binding data and display? If it can,how to use?Thanks!

@beto-rodriguez
Copy link
Collaborator

Yes it can. it is ready for wpf bindings you could use all you know with wpf to make this work. I currently don't have an example. Maybe and just maybe in a future I will add an example to test project. Please try it if something is not working I can help you.

Thanks.

@gregsdennis
Copy link
Contributor

I had to create an attached property in order to fill in data from my view model in C#. Is there a pure-XAML solution?

@beto-rodriguez
Copy link
Collaborator

it should be possible the problem I see is that write the next block of code as Xaml will result complex, I think an IValueConverter could be a good solution

LineChart.Series = new ObservableCollection<Serie>
            {
                new LineSerie
                {
                    PrimaryValues = new ObservableCollection<double>
                    {
                        -10, 5, 9, 28, -3, 2, 0, 5, 10, 1, 7, 2
                    }
                }
            };

@gregsdennis
Copy link
Contributor

@flyaim,

@beto-rodriguez merged in some changes today that should help with your MVVM needs. Download the latest source and look at the XAML in the second tab for how to bind data.

@beto-rodriguez
Copy link
Collaborator

I am closing this issue, now Test project includes an MVVM example for each chart

@flyaim
Copy link
Author

flyaim commented Dec 9, 2015

@beto-rodriguez
@gregsdennis
got it,i will try,thank you!

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

No branches or pull requests

3 participants