Hi I've xampiechart which should be connected to xamdatagrid. I mean sliceclick on piechart should filter datagrid. for that I need connect xampiechart sliceClick to the command of my view model. How can i implement event command binding for xampiechart?
Thanks
Hello Xetish,
Thank you for your post!
I have been investigating this, and it seems that simply binding to an ICommand in your ViewModel won't be enough to filter a connected XamDataGrid, mainly because you will need the event arguments of the SliceClicked event to get the data item and information about the slice that you clicked. I would recommend you to this thread on stack overflow which details a behavior you can use to pass event arguments to a command as a parameter: http://stackoverflow.com/questions/6205472/mvvm-passing-eventargs-as-command-parameter.
I have also created a sample based on the concepts presented on that thread to demonstrate one way that you could filter a XamDataGrid through exploding the slices of the XamPieChart.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for help, Bye the way, for some of slieces SliceClick event args contain wrong DataContext. In my case for almost all slices eventArgs.DataContext is of type KeyValuePair<Type1, Type2> but for some of slices DataContext is of type List<KeyValuePair<Type1, Type2>>. Chart Source is bounded to Dictionaty<Type1, Type2>.
Do you have Any Idea?