开发者

Binding Silverlight Charts in Code Behind

I have a list of objects (custom) with two properties each (date, value) and I'd like to bind this list to a LineSeries object.

This is what I have so far...

        var series = new LineSeries();
        series.ItemsSource = this._storObj;  // This is the List<object>
        storage开发者_如何学编程Chart.Series.Add(series);

How do I tell the series what properties to use on the objects in the code-behind. I've seen many XAML examples but need to do this in the code behind.

Thanks!

Jeffrey Kevin Pry


Something like this maybe ?

series.DependentValueBinding = new Binding("NameOfYourValueProperty");
series.IndependentValueBinding = new Binding("Date");

Hope that helps ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜