using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 TelerikSortingError.ServiceReference1;

namespace TelerikSortingError
{
	public partial class MainWindow : MetroWindow, INotifyPropertyChanged
	{
		#region INotifyPropertyChanged

		public void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));

		public event PropertyChangedEventHandler PropertyChanged;

		#endregion

		#region ListOfItems INPC Property
		private ObservableCollection<item> _listofitems;

		public ObservableCollection<item> ListOfItems
		{
			get { return _listofitems; }
			set { _listofitems = value; OnPropertyChanged("ListOfItems"); }
		}
		#endregion

		#region VintageYear INPC Property
		private int? vintageYear;

		public int? VintageYear
		{
			get { return vintageYear; }
			set { vintageYear = value; OnPropertyChanged("VintageYear"); }
		}
		#endregion

		Service1Client client;

		public MainWindow()
		{
			InitializeComponent();

			client = new Service1Client();

			ListOfItems = client.ItemList();
		}

		private void SortedVariants_Filter(object sender, FilterEventArgs e)
		{
			e.Accepted = true;
		}
	}
}
