通过 MVVM 在此处寻找有关数据绑定(bind)和 amCharts 的一些帮助。目前我有:
一个名为 AskCollection 的 ObservableCollection
这是 SymbolObjectModels 的集合
每个模型包含:
public double Size { get; set; }
public double BidAsk { get; set; }
public string QuoteID { get; set; }
目前我正在尝试按如下方式在 XAML 中绑定(bind)数据,但没有成功:
<xaml>
<am:LineChart Grid.ColumnSpan="2" SeriesSource="{Binding AskCollection}" IDMemberPath="{Binding QuoteID}" Background="DimGray">
<am:LineChart.Graphs>
<am:LineChartGraph DataItemsSource="{Binding AskCollection}" ValueMemberPath="{Binding BidAsk}" SeriesIDMemberPath="{Binding QuoteID}">
</am:LineChartGraph>
</am:LineChart.Graphs>
</am:LineChart>
</xaml>
不幸的是,没有出现折线图 :( 我也尝试过使用 List 而不是 ObservableCollection,但仍然不开心。
谁能看出我做错了什么?
非常感谢,干杯。
最佳答案
IDMemberPath、ValueMemberPath 等应该是属性名称,而不是绑定(bind)。 IE。 IDMemberPath="QuoteID", 等等
关于c# - amCharts:帮助 WPF MVVM 数据绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5170262/