コード例 #1
0
        public CreateItemViewModel(
            IViewModelsFactory<IItemOverviewStepViewModel> overviewVmFactory,
            IViewModelsFactory<IItemPropertiesStepViewModel> propertiesVmFactory,
            IViewModelsFactory<IItemPricingStepViewModel> pricingVmFactory,
            IViewModelsFactory<IEditorialReviewViewModel> reviewVmFactory,
            Item item, IViewModel parentEntityVM, ICatalogEntityFactory entityFactory)
        {
            _itemModel = new ItemStepModel
                {
                    InnerItem = item,
                    ParentEntityVM = parentEntityVM,
                    ParentWizard = this
                };

            var allParameters = new[] { new KeyValuePair<string, object>("itemModel", _itemModel) };

            // properties Step must be created first
            var propertiesStep = propertiesVmFactory.GetViewModelInstance(allParameters);
            // this step is created second, but registered first
            RegisterStep(overviewVmFactory.GetViewModelInstance(allParameters));
            RegisterEditorialReviewStep(item, entityFactory, reviewVmFactory);

            // properties Step is registered third
            RegisterStep(propertiesStep);

            pricingStep4 = pricingVmFactory.GetViewModelInstance(allParameters);
            // this step is added or removed at RUNTIME
            // RegisterStep(pricingStep4);

            item.StartDate = DateTime.Today;
        }
コード例 #2
0
        public CreateItemViewModel(
            IViewModelsFactory <IItemOverviewStepViewModel> overviewVmFactory,
            IViewModelsFactory <IItemPropertiesStepViewModel> propertiesVmFactory,
            IViewModelsFactory <IItemPricingStepViewModel> pricingVmFactory,
            IViewModelsFactory <IEditorialReviewViewModel> reviewVmFactory,
            Item item, IViewModel parentEntityVM, ICatalogEntityFactory entityFactory)
        {
            _itemModel = new ItemStepModel
            {
                InnerItem      = item,
                ParentEntityVM = parentEntityVM,
                ParentWizard   = this
            };

            var allParameters = new[] { new KeyValuePair <string, object>("itemModel", _itemModel) };

            // properties Step must be created first
            var propertiesStep = propertiesVmFactory.GetViewModelInstance(allParameters);

            // this step is created second, but registered first
            RegisterStep(overviewVmFactory.GetViewModelInstance(allParameters));
            RegisterEditorialReviewStep(item, entityFactory, reviewVmFactory);

            // properties Step is registered third
            RegisterStep(propertiesStep);

            pricingStep4 = pricingVmFactory.GetViewModelInstance(allParameters);
            // this step is added or removed at RUNTIME
            // RegisterStep(pricingStep4);

            item.StartDate = DateTime.Today;
        }
コード例 #3
0
 public ItemOverviewStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }
コード例 #4
0
 public ItemPricingStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IRepositoryFactory <IPricelistRepository> pricelistRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory <IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, null, entityFactory, authContext, itemModel, priceVmFactory)
 {
     IsInitializingPricing = true;
 }
コード例 #5
0
 public ItemPropertiesStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues           = new ObservableCollection <PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
コード例 #6
0
 protected ItemStepViewModel(
     IRepositoryFactory <ICatalogRepository> repositoryFactory,
     IRepositoryFactory <IPricelistRepository> pricelistRepositoryFactory,
     IViewModelsFactory <IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory <IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, authContext, priceVmFactory)
 {
     stepModel = itemModel;
 }
コード例 #7
0
 public ItemPricingStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory<IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, null, entityFactory, authContext, itemModel, priceVmFactory)
 {
     IsInitializingPricing = true;
 }
コード例 #8
0
 public ItemPropertiesStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = new ObservableCollection<PropertyAndPropertyValueBase>();
     stepModel.PropertiesAndValues = PropertiesAndValues;
 }
コード例 #9
0
 public ItemOverviewStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel)
     : base(repositoryFactory, null, vmFactory, entityFactory, authContext, itemModel, null)
 {
     PropertiesAndValues = stepModel.PropertiesAndValues;
 }
コード例 #10
0
 protected ItemStepViewModel(
     IRepositoryFactory<ICatalogRepository> repositoryFactory,
     IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory,
     IViewModelsFactory<IPropertyValueBaseViewModel> vmFactory,
     ICatalogEntityFactory entityFactory,
     IAuthenticationContext authContext,
     ItemStepModel itemModel,
     IViewModelsFactory<IPriceViewModel> priceVmFactory)
     : base(repositoryFactory, pricelistRepositoryFactory, vmFactory, entityFactory, itemModel.InnerItem, authContext, priceVmFactory)
 {
     stepModel = itemModel;
 }