using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();

            DataContext = new MyDataContext();
        }
    }

    public class MyDataContext
    {
        ObservableCollection<MyObject> _Data;
        public ObservableCollection<MyObject> Data
        {
            get
            {
                if (_Data == null)
                {
                    _Data = new ObservableCollection<MyObject>(
                    from i in Enumerable.Range(0, 10)
                    select new MyObject()
                    {
                        ID = i,
                        Name = String.Format("Name{0}", i)
                    });
                }
                return _Data;
            }
        }

        public string Test 
        {
            get
            {
                return "Test";
            }
        }  
    }

    public class MyObject
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
}
