Sparky
Sparky

Reputation: 415

amCharts: Help with WPF MVVM Data Binding?

Looking a bit of help with Data Binding here and amCharts, through MVVM. At the minute I have:

An ObservableCollection, named AskCollection

This is a collection of SymbolObjectModels

Each Model contains a:

public double Size { get; set; }
public double BidAsk { get; set; }
public string QuoteID { get; set; }

Currently I'm attempting to bind the data in the XAML as follows, with no luck:

<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>

Unfortunately, there is no Line Chart appearing :( I also tried with a List opposed to an ObservableCollection, still no joy.

Can anyone see what I'm doing wrong?

Much appreciated, Cheers.

Upvotes: 2

Views: 2039

Answers (1)

Alan Mendelevich
Alan Mendelevich

Reputation: 3611

IDMemberPath, ValueMemberPath, etc. are supposed to be property names, not bindings. Ie. IDMemberPath="QuoteID", etc.

Upvotes: 2

Related Questions