Пример #1
0
        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();
            });
        }
Пример #2
0
        public ProductDetailPage()
        {
            InitializeComponent();

            var product = new Product
            {
                Name   = "TEST",
                Price  = 0,
                Amount = 0
            };

            viewModel      = new BaseDetailViewModel <Product>(product);
            BindingContext = viewModel;
        }
Пример #3
0
 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;
         }
     }
 }
Пример #4
0
 protected void InitBaseDetailViewModel(BaseDetail model, BaseDetailViewModel viewModel)
 {
     viewModel.EntityStateNameCode = EntityCacheRepository.GetEntityStateNameCode(model.EntityStateId);
 }
Пример #5
0
 public ContactDetailPage(BaseDetailViewModel <Contact> viewModel)
 {
     InitializeComponent();
     BindingContext       = this.viewModel = viewModel;
     this.viewModel.Title = viewModel.Item.Name;
 }