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.Collections.ObjectModel;

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

			this.myGridView.ItemsSource = GenerateProducts();
		}

		private ObservableCollection<ProductViewModel> GenerateProducts()
		{
			ObservableCollection<ProductViewModel> result = new ObservableCollection<ProductViewModel>();
			for (int i = 1; i < 20; i++)
			{
				ProductViewModel product = new ProductViewModel()
				{
					Name = String.Format("Name {0}", i),
					Description = String.Format("Description {0}", i),
					UnitPrice = i * 100
				};
				result.Add(product);
			}
			return result;
		}
	}

	#region Data Collections

	public class ProductViewModel
	{
		public string Name { get; set; }
		public string Description { get; set; }
		public decimal UnitPrice { get; set; }

	}

	#endregion
}
