using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

using C1.Xaml.Chart;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace ChartSamples
{
    public sealed partial class Selection : UserControl
    {
        Random rnd = new Random();

        public Selection()
        {
            this.InitializeComponent();

            // create sample data
            List<Product> products = new List<Product>();

            for (int i = 0; i < 8; i++)
                products.Add(new Product() { Name = "Product " + i, Price = rnd.Next(5, 50) });

            CollectionViewSource cvs = new CollectionViewSource();
            cvs.Source = products;

            c1Chart1.BeginUpdate();
            // set data source

            c1Chart1.Data.ItemsSource = cvs.View;
            c1Chart1.EndUpdate();

            flexGrid.ItemsSource = cvs.View;
        }


    }

    public class Product
    {
        public string Name { get; set; }
        public double Price { get; set; }
    }

    
}
