using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Telerik.Windows.Data;
using System.Collections.ObjectModel;

namespace SelectedDataRecordsBinding_Wpf_2009_Q11
{
	public class SelectedRecordsConverter : IValueConverter
	{

		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			SelectedRecordsCollection selectedRecords = (SelectedRecordsCollection)value;

			// wrap the original collection into a new collection that gives a direct access to the data items
			return new WrapperCollection(selectedRecords);
		}


		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
