public EntityListPage()
 {
     _vm = new EntityListViewModel();
     BindingContext = _vm;
     _vm.AddItemClicked += OnAddBtnClicked;
     _vm.ItemSelected += OnItemSelected;
     InitializeComponent();
 }
Ejemplo n.º 2
0
 public AddEntityPage(EntityListViewModel entityListViewModel)
 {
     InitializeComponent();
     _entityListViewModel = entityListViewModel;
     var vm = new AddEntityViewModel();
     vm.ItemAdded += _entityListViewModel.OnNewItemAdded;
     vm.ItemSaved += OnBtnClicked;
     vm.ItemCanceled += OnBtnClicked;
     vm.ItemDeleted += OnBtnClicked;
     BindingContext = vm;
 }
 public EditEntityViewPage(Guid id, EntityListViewModel entityListViewModel)
 {
     _entityListViewModel = entityListViewModel;
     InitializeComponent();
     var vm = new AddEntityViewModel(id, DependencyService.Get<IEntityService>());
     vm.ItemDeleted += OnBtnClicked;
     vm.ItemEdited += _entityListViewModel.OnItemEdited;
     vm.ItemSaved += OnBtnClicked;
     vm.ItemCanceled += OnBtnClicked;
     vm.WhatItemDeleted += _entityListViewModel.Delete;
     BindingContext = vm;
 }