public ContactListPage()
 {
     _vm = new ContacListViewModel(DependencyService.Get<IContactService>());
     BindingContext = _vm;
     _vm.AddItemClicked += OnAddBtnClicked;
     _vm.ItemSelected += OnItemSelected;
     InitializeComponent();
 }
 public ContactViewPage(Guid id, ContacListViewModel contacListViewModel)
 {
     _contacListViewModel = contacListViewModel;
     InitializeComponent();
     var vm = new ContactViewModel(id, DependencyService.Get<IContactService>());
     vm.ItemDeleted += OnBtnClicked;
     vm.WhatItemDeleted += _contacListViewModel.Delete;
     BindingContext = vm;
 }
 public AddContactPage(ContacListViewModel contactsListViewModel)
 {
     InitializeComponent();
     _contactsListViewModel = contactsListViewModel;
     var vm = new ContactViewModel();
     vm.ItemAdded += _contactsListViewModel.OnNewItemAdded;
     vm.ItemSaved += OnBtnClicked;
     vm.ItemCanceled += OnBtnClicked;
     vm.WhatItemDeleted += _contactsListViewModel.Delete;
     vm.ItemDeleted += OnBtnClicked;
     BindingContext = vm;
 }