using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Charting;

namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }

    public class ViewModel : ViewModelBase
    {
        private List<ChartData> data;

        public ViewModel()
        {
            this.Data = this.GetData();
        }

        public List<ChartData> Data
        {
            get
            {
                return this.data;
            }
            set
            {
                if (this.data != value)
                {
                    this.data = value;
                    this.OnPropertyChanged("Data");
                }
            }
        }

        private List<ChartData> GetData()
        {
            List<ChartData> data = new List<ChartData>();
            data.Add(new ChartData() { OverallQualityIndex = 1, OverallCostIndex = 10, BubbleSize = 200 });
            data.Add(new ChartData() { OverallQualityIndex = 2, OverallCostIndex = 20, BubbleSize = 100 });
            data.Add(new ChartData() { OverallQualityIndex = 3, OverallCostIndex = 30, BubbleSize = 50 });
            data.Add(new ChartData() { OverallQualityIndex = 4, OverallCostIndex = 50, BubbleSize = 10 });
            data.Add(new ChartData() { OverallQualityIndex = 5, OverallCostIndex = 40, BubbleSize = 700 });
            data.Add(new ChartData() { OverallQualityIndex = 6, OverallCostIndex = 20, BubbleSize = 20 });
            data.Add(new ChartData() { OverallQualityIndex = 7, OverallCostIndex = 30, BubbleSize = 70 });
            data.Add(new ChartData() { OverallQualityIndex = 8, OverallCostIndex = 70, BubbleSize = 100 });

            return data;
        }
    }

    public class ChartData
    {
        public double OverallQualityIndex
        {
            get;
            set;
        }

        public double OverallCostIndex
        {
            get;
            set;
        }

        public double BubbleSize
        {
            get;
            set;
        }
    }
}
