using Hierarchy_WCFService.ServiceReference1;
using System;
using System.Collections.ObjectModel;
using System.Windows.Controls;

namespace Hierarchy_WCFService
{
	public partial class MainPage : UserControl
	{
		ObservableCollection<Customer> customers;
		ObservableCollection<Order> orders;
		
		public MainPage()
		{
			InitializeComponent();
			Service1Client client = new Service1Client();
			client.CustomerListCompleted+=new EventHandler<CustomerListCompletedEventArgs>(client_CustomerListCompleted);
			client.CustomerListAsync();

			client.OrderListCompleted += new EventHandler<OrderListCompletedEventArgs>(client_OrderListCompleted);
			client.OrderListAsync();
			
		}

		void client_OrderListCompleted(object sender, OrderListCompletedEventArgs e)
		{
			this.customersGrid.ItemsSource = e.Result;			
		}

		private void client_CustomerListCompleted(object sender, CustomerListCompletedEventArgs e)
		{
			
		}
	}
}
