public ProductDetailPage(BaseDetailViewModel <Product> viewModel) { InitializeComponent(); BindingContext = this.viewModel = viewModel; this.viewModel.Title = this.viewModel.Item.Name; MessagingCenter.Subscribe <ProductEditPage, Product>(this, "EditItem", async(obj, editedProduct) => { await Navigation.PopAsync(); }); }
public ProductDetailPage() { InitializeComponent(); var product = new Product { Name = "TEST", Price = 0, Amount = 0 }; viewModel = new BaseDetailViewModel <Product>(product); BindingContext = viewModel; }
protected void InitBaseDetailEntityStateChange(BaseDetailViewModel detailViewModel) { detailViewModel.HasEntityStateChangeAccess = false; if (detailViewModel.AccessTypeId == Dom.AccessType.ReadWrite) { IDictionary <int, string> entityTransitions = EntityContext.GetAccesibleEntityTransitionsFrom(detailViewModel.EntityStateId, detailViewModel.EntityTypeId, detailViewModel.OrganizationId); if (!entityTransitions.IsNullOrEmpty()) { detailViewModel.EntityStateChange = new EntityStateChangeViewModel { EntityInfoId = detailViewModel.EntityInfoId, OrganizationId = detailViewModel.OrganizationId, EntityTransitions = entityTransitions }; detailViewModel.HasEntityStateChangeAccess = true; } } }
protected void InitBaseDetailViewModel(BaseDetail model, BaseDetailViewModel viewModel) { viewModel.EntityStateNameCode = EntityCacheRepository.GetEntityStateNameCode(model.EntityStateId); }
public ContactDetailPage(BaseDetailViewModel <Contact> viewModel) { InitializeComponent(); BindingContext = this.viewModel = viewModel; this.viewModel.Title = viewModel.Item.Name; }