Hi,
I can get XamWebChart to graph data using the following C# code:
Series PullSeries = new Series { Label = "pulls", ChartType = ChartType.Line, DataMapping = "label=SDate;value=Pulls;", DataSource = e.Result }
PullsChart.Series.Add(PullandDeadsSeries);
e being = OnFeed_SL.ServiceReference1.GetPullsAndDeadsSTRDateCompletedEventArgs
To do the above what would be a code example in XAML... What I am trying to do is the graph using BLEND to develop with and let BLEND connect up to the data source using XAML.
THANKS
Keith
If that code behind is in your window or usercontrol class, set this.DataContext equal to the e.Result when the web service call returns, this has established the web service result as the data context for binding in the XAML for any children of the window/usercontrol.
Then your series can look like this in XAML:
<igChart:XamWebChart.Series>
<igChart:Series Label="pulls"
ChartType="Line"
DataSource="{Binding}"
DataMapping="Label = SDate; Value = Pulls"/>
</igChart:XamWebChart.Series>
This help?
-Graham
the handler in the code behind:
void _client_GetPullsAndDeadsSTRDateCompleted(object sender,
OnFeed_SL.ServiceReference1.GetPullsAndDeadsSTRDateCompletedEventArgs e)
{
DataContext = e.Result;
}
Basically, you need some code behind in this case to establish the data context because the WCF service requires you to execute and respond to an asynchronous call in order to retrieve the data. You could wrap a class around the service and try to make the call execute synchronously if you wanted to just instantiate the class in the Xaml and bind to it.