Getting item on click (Pie Chart)

May 23, 2015 at 5:21 AM
Hello


Can any one help me on getting the item which one i click on pie chart
My code:

public class MainViewModel : MainWindow
{
    public ObservableCollection<TestClass> Errors { get; private set; }

    public MainViewModel()
    {
        Errors = new ObservableCollection<TestClass>();
        Errors.Add(new TestClass() { Category = "Globalization", Number = 75 });
        Errors.Add(new TestClass() { Category = "Features", Number = 2 });
        Errors.Add(new TestClass() { Category = "ContentTypes", Number = 12 });
        Errors.Add(new TestClass() { Category = "Correctness", Number = 83 });
        Errors.Add(new TestClass() { Category = "Best Practices", Number = 29 });
    }

    private object selectedItem = null;
    public object SelectedItem
    {
        get
        {
            return selectedItem;
        }
        set
        {
            // selected item has changed
            selectedItem = value;
            selectedItemChangeHandler();
        }
    }

    public void selectedItemChangeHandler()
    {
        //on selected item changed   

    }
}
how can i get the category with selected item on change?
Anyone help me?