using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.Windows.Controls;
using System.Windows.Controls;
using System.Windows.Media;

namespace WPF.Images
{
	public  class GridViewClearImageColumn:GridViewImageColumn
	{
		public override System.Windows.FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
		{
			var item = base.CreateCellElement(cell, dataItem);

			var image = item as Image;

			if (image != null)
			{
				image.SnapsToDevicePixels = true;
				RenderOptions.SetBitmapScalingMode(image, BitmapScalingMode.NearestNeighbor);
				item = image;
			}

			return item;
		}
	}
}
