public ViewCustomer()
 {
     InitializeComponent();
     ViewModel = new CustomerViewModel(this);
     DataContext = ViewModel;
     _photoChooserTask = new PhotoChooserTask();
     _photoChooserTask.Completed += _photoChooserTask_Completed;
     _cameraCaptureTask = new CameraCaptureTask();
     _cameraCaptureTask.Completed += _cameraCaptureTask_Completed;
 }
 private void ListCustomers_OnCustomerClicked(object sender, CustomerClickedEventArgs e)
 {
     if (e.Customer == null) return;
     _selectedCustomer = e.Customer;
     NavigationService.Navigate(new Uri("/ViewCustomer.xaml", UriKind.Relative));
 }
 public CustomerClickedEventArgs(CustomerViewModel customer)
 {
     Customer = customer;
 }
 public void DisplayCustomers(Customer[] collection)
 {
     Customers.Clear();
     RawCustomers.Clear();
     RawCustomers.AddRange(collection);
     foreach (var contact in collection.Maybe(_ => _, new Contact[0]))
     {
         var customer = new CustomerViewModel(_keyService)
             {
                 Customer = contact,
                 CompanyFile = _companyFileModel.CompanyFile,
                 Credentials = new CompanyFileCredentials(CompanyFile.Authentication[0].Username, CompanyFile.Authentication[0].Password)
             };
         Customers.Add(customer);
         customer.FetchPicture();
     }
 }