using System.ComponentModel;
using System.Data;

namespace RadGridView_WPF_AR_3
{
	public class ViewModel : INotifyPropertyChanged
	{
		public ViewModel()
		{

			MyData = new DataView(GetDummyData());
		}

		private DataView _myData;
		public DataView MyData
		{
			get { return _myData; }
			set
			{
				if (_myData != value)
				{
					_myData = value; OnPropertyChanged("MyData");
				}

			}
		}


		private void OnPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		private DataTable GetDummyData()
		{
			var table = new DataTable();
			table.Columns.Add("Column 1", typeof(string));

			table.Rows.Add("asdfffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");

			return table;
		}


		public event PropertyChangedEventHandler PropertyChanged;
	}
}