using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls.ScheduleView;
using Telerik.Windows.Controls;

namespace WpfApplication17
{
	public class MyViewModel
	{
		public MyViewModel()
		{
			this.resourceTypes = this.GenerateResourceTypes();
			this.appointments = new ObservableCollection<Appointment>();
			for (var i = 0; i < 20; i++)
			{
				for(var j=0; j< 20; j++)
				{
					var a = new Appointment() { Start = DateTime.Now, End = DateTime.Now.AddHours(3), Subject = i.ToString() };
					a.Resources.Add(new Resource("Room" + i, "Room"));
					this.appointments.Add(a);
				}
			}
		}
		private ObservableCollection<Appointment> appointments;
		private ObservableCollection<ResourceType> resourceTypes;
		public ObservableCollection<Appointment> Appointments
		{
			get
			{
				return this.appointments;
			}
			set
			{
				this.appointments = value;
			}
		}
		public ObservableCollection<ResourceType> ResourcesTypes
		{
			get
			{
				return this.resourceTypes;
			}
			set
			{
				this.resourceTypes = value;
			}
		}
		private ObservableCollection<ResourceType> GenerateResourceTypes()
		{
			ObservableCollection<ResourceType> result = new ObservableCollection<ResourceType>();

			ResourceType roomType = new ResourceType("Room");
			Resource room102 = new Resource("Room 102");
			Resource room203 = new Resource("Room 203");
			Resource room406 = new Resource("Room 406");
			roomType.Resources.Add(room102);
			roomType.Resources.Add(room203);
			roomType.Resources.Add(room406);

			ResourceType speakerType = new ResourceType("Speaker");
			Resource tomSpeaker = new Resource("Tom");
			Resource peterSpeaker = new Resource("Peter");
			speakerType.Resources.Add(tomSpeaker);
			speakerType.Resources.Add(peterSpeaker);

			result.Add(roomType);
			result.Add(speakerType);
			return result;
		}
	}

}
