using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Olympics.WSData;
using System.Windows.Media.Imaging;

namespace Olympics
{
    public partial class MyChartLabel : UserControl
    {
        public MyChartLabel()
        {
            InitializeComponent();
        }

        public CountryInfo Data
        {
            get { return (CountryInfo)GetValue(DataProperty); }
            set { SetValue(DataProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Data.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DataProperty =
            DependencyProperty.Register("Data",
                        typeof(CountryInfo),
                        typeof(MyChartLabel),
                        new PropertyMetadata(new PropertyChangedCallback((obj, arg) =>
                        {
                            MyChartLabel sender = (MyChartLabel) obj;
                            CountryInfo value = (CountryInfo)arg.NewValue;

                            sender.txt.Text = value.CountryName;
                        })));
    }
}
