public CustomerSelectionViewData GetCustomerSelectionViewData(string cityFilter) { CustomerSelectionViewData vd = new CustomerSelectionViewData(); vd.Customers = new ObservableCollection<CustomerListItemViewData>(); foreach (var customer in cusRep.GetListOfCustomers(cityFilter)) { vd.Customers.Add(new CustomerListItemViewData() { CustomerID = customer.CustomerID, FirstName = customer.FirstName, LastName = customer.LastName, Address = customer.Address, City = customer.City, ZipCode = customer.ZipCode, Country = customer.Country, Email = customer.Email, TelephoneNumber = customer.TelephoneNumber, MobileNumber = customer.MobileNumber, CreditCardNumber = customer.CreditCardNumber, ExpirationDate = customer.ExpirationDate, }); } return vd; }
public DesignTimeCustomerSelectionViewModel() { ViewData = new CustomerSelectionViewData(); var customers = new ObservableCollection<CustomerListItemViewData>(); customers.Add( new CustomerListItemViewData() { CustomerID = 1, FirstName = "Jack", LastName = "Done", Address = "In denmark somewhere", City = "Odense", ZipCode = "5200", Country = "romania", Email = "*****@*****.**", TelephoneNumber = "0000 444 444 44", MobileNumber = "0000 444 444 44", CreditCardNumber = "0000 0000 0000 0000 0000", ExpirationDate = DateTime.Now, }); ((CustomerSelectionViewData)ViewData).Customers = customers; }