本文整理汇总了C#中IViewModelsFactory.GetViewModelInstance方法的典型用法代码示例。如果您正苦于以下问题:C# IViewModelsFactory.GetViewModelInstance方法的具体用法?C# IViewModelsFactory.GetViewModelInstance怎么用?C# IViewModelsFactory.GetViewModelInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IViewModelsFactory
的用法示例。
在下文中一共展示了IViewModelsFactory.GetViewModelInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaxesMainSettingsViewModel
public TaxesMainSettingsViewModel(
ITaxCategorySettingsViewModel taxCategorySettingsViewModel,
ITaxSettingsViewModel taxSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IViewModelsFactory<ITaxImportHomeViewModel> importVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxCategories))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Tax categories", Category = NavigationNames.ModuleName, ViewModel = taxCategorySettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", Category = NavigationNames.ModuleName, ViewModel = jSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", Category = NavigationNames.ModuleName, ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxes))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Taxes", Category = NavigationNames.ModuleName, ViewModel = taxSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxImport))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = Configuration.NavigationNames.HomeName, Caption = "Import", Category = NavigationNames.ModuleName, ViewModel = importVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("parentViewModel", this)) });
}
CurrentTab = SubItems[0];
}
示例2: CreateItemViewModel
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: TreeCatalogViewModel
public TreeCatalogViewModel(
IViewModelsFactory<ICatalogViewModel> vmFactory,
catalogModel.Catalog item,
IRepositoryFactory<ICatalogRepository> repositoryFactory,
IAuthenticationContext authContext,
INavigationManager navigationManager,
IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory,
IViewModelsFactory<ITreeCategoryViewModel> treeCategoryVmFactory,
IDataManagementService exportService)
: base(repositoryFactory, authContext)
{
InnerItem = item;
EmbeddedHierarchyEntry = this;
_catalogDeleteVmFactory = catalogDeleteVmFactory;
_treeCategoryVmFactory = treeCategoryVmFactory;
_exportService = exportService;
OpenItemCommand = new DelegateCommand(() =>
{
if (NavigationData == null)
{
var editVM = vmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem)
, new KeyValuePair<string, object>("parentTreeVM", this));
NavigationData = ((IClosable)editVM).NavigationData;
}
navigationManager.Navigate(NavigationData);
});
ExportItemCommand = new DelegateCommand(() => RaiseExportItemCommand());
}
示例4: ShippingMainSettingsViewModel
public ShippingMainSettingsViewModel(
IShippingOptionSettingsViewModel shippingOptionSettingsViewModel,
IShippingMethodSettingsViewModel shippingMethodSettingsViewModel,
IShippingPackageSettingsViewModel shippingPackageSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jurisdictionSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingOptions))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping options", ViewModel = shippingOptionSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingMethods))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping methods", ViewModel = shippingMethodSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingPackages))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping packages", ViewModel = shippingPackageSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", ViewModel = jurisdictionSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
CurrentTab = SubItems[0];
}
示例5: TreeVirtualCatalogViewModel
public TreeVirtualCatalogViewModel(
IViewModelsFactory<ITreeCategoryViewModel> vmFactory,
IViewModelsFactory<IVirtualCatalogViewModel> virtualCatalogVmFactory,
IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory,
CatalogBase item,
IRepositoryFactory<ICatalogRepository> repositoryFactory,
IAuthenticationContext authContext,
INavigationManager navigationManager)
: base(repositoryFactory, authContext)
{
InnerItem = item;
_vmFactory = vmFactory;
_catalogDeleteVmFactory = catalogDeleteVmFactory;
EmbeddedHierarchyEntry = this;
ViewTitle = new ViewTitleBase
{
SubTitle = "VIRTUAL CATALOG",
Title = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : ""
};
OpenItemCommand = new DelegateCommand(() =>
{
if (NavigationData == null)
{
var editVM = virtualCatalogVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem)
, new KeyValuePair<string, object>("parentTreeVM", this));
NavigationData = ((IClosable)editVM).NavigationData;
}
navigationManager.Navigate(NavigationData);
});
}
示例6: ConfigurationWizardViewModel
public ConfigurationWizardViewModel(
Project item,
IRepositoryFactory<IProjectRepository> projectRepositoryFactory,
IViewModelsFactory<IProjectLocationStepViewModel> projectLocationStepVmFactory,
IViewModelsFactory<IDatabaseSettingsStepViewModel> databaseSettingsStepVmFactory,
IViewModelsFactory<ISearchSettingsStepViewModel> searchSettingsStepVmFactory,
IViewModelsFactory<IConfigurationViewModel> configurationVmFactory,
IViewModelsFactory<IConfirmationStepViewModel> confirmationStepVmFactory,
NavigationManager navigationManager
)
{
_item = item;
_projectRepositoryFactory = projectRepositoryFactory;
_navigationManager = navigationManager;
// initializing step instances
_confirmationViewModel = confirmationStepVmFactory.GetViewModelInstance();
var confirmParam = new KeyValuePair<string, object>("confirmationViewModel", _confirmationViewModel);
_searchSettingsStepViewModel = searchSettingsStepVmFactory.GetViewModelInstance(confirmParam);
var searchParam = new KeyValuePair<string, object>("searchViewModel", _searchSettingsStepViewModel);
_databaseSettingsStepViewModel = databaseSettingsStepVmFactory.GetViewModelInstance(confirmParam);
var dbParam = new KeyValuePair<string, object>("databaseViewModel", _databaseSettingsStepViewModel);
_projectLocationStepViewModel = projectLocationStepVmFactory.GetViewModelInstance(confirmParam, searchParam, dbParam);
var locationParam = new KeyValuePair<string, object>("projectLocationViewModel", _projectLocationStepViewModel);
_configurationViewModel = configurationVmFactory.GetViewModelInstance(locationParam, dbParam, searchParam);
Initialize();
RegisterWizardSteps();
}
示例7: CreateShippingOptionViewModel
public CreateShippingOptionViewModel(
IViewModelsFactory<IShippingOptionOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<IShippingOptionPackagesStepViewModel> packagesVmFactory,
ShippingOption item)
{
var itemParameter = new KeyValuePair<string, object>("item", item);
RegisterStep(overviewVmFactory.GetViewModelInstance(itemParameter));
RegisterStep(packagesVmFactory.GetViewModelInstance(itemParameter));
}
示例8: CreateCatalogPromotionViewModel
public CreateCatalogPromotionViewModel(
IViewModelsFactory<ICatalogPromotionOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<ICatalogPromotionExpressionStepViewModel> expressionVmFactory,
Promotion item)
{
var parametr = new KeyValuePair<string, object>("item", item);
RegisterStep(overviewVmFactory.GetViewModelInstance(parametr));
RegisterStep(expressionVmFactory.GetViewModelInstance(parametr));
}
示例9: CreateShippingMethodViewModel
public CreateShippingMethodViewModel(
IViewModelsFactory<IShippingMethodOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<IShippingMethodSettingsStepViewModel> settingsVmFactory,
IViewModelsFactory<IGeneralLanguagesStepViewModel> languagesVmFactory,
ShippingMethod item)
{
var itemParameter = new KeyValuePair<string, object>("item", item);
RegisterStep(overviewVmFactory.GetViewModelInstance(itemParameter));
RegisterStep(settingsVmFactory.GetViewModelInstance(itemParameter));
RegisterStep(languagesVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("selectedLanguages", item.ShippingMethodLanguages)));
}
示例10: CreatePaymentViewModel
public CreatePaymentViewModel(
IViewModelsFactory<IPaymentMethodStepViewModel> paymentMethodStepVmFactory,
IViewModelsFactory<IPaymentDetailsStepViewModel> detailsStepVmFactory,
IPaymentMethodRepository paymentMethodRepository)
{
_paymentMethodRepository = paymentMethodRepository;
var itemRepositoryParameter = new KeyValuePair<string, object>("itemRepository", _paymentMethodRepository);
RegisterStep(paymentMethodStepVmFactory.GetViewModelInstance(itemRepositoryParameter));
RegisterStep(detailsStepVmFactory.GetViewModelInstance(itemRepositoryParameter));
}
示例11: RegisterEditorialReviewStep
private void RegisterEditorialReviewStep(Item parentItem, ICatalogEntityFactory entityFactory, IViewModelsFactory<IEditorialReviewViewModel> vmFactory)
{
var item = (EditorialReview)entityFactory.CreateEntityForType(typeof(EditorialReview));
item.CatalogItem = parentItem;
item.Priority = 1;
item.Source = "Product Description";
var retVal = vmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item),
new KeyValuePair<string, object>("isWizardMode", true));
RegisterStep(retVal);
}
示例12: CreateImportJobViewModel
public CreateImportJobViewModel(
IViewModelsFactory<IImportJobOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<IImportJobMappingStepViewModel> mappingVmFactory,
ImportJob item,
ImportEntityType[] entityImporters)
{
var itemParameter = new KeyValuePair<string, object>("item", item);
var parentVM = new KeyValuePair<string, object>("parentVM", this);
var _entityImporters = new KeyValuePair<string, object>("entityImporters", entityImporters);
RegisterStep(overviewVmFactory.GetViewModelInstance(itemParameter, parentVM, _entityImporters));
RegisterStep(mappingVmFactory.GetViewModelInstance(itemParameter, parentVM));
}
示例13: CreateRefundViewModel
public CreateRefundViewModel(
IViewModelsFactory<IRefundDetailsStepViewModel> detailsVmFactory,
IViewModelsFactory<IRefundSummaryStepViewModel> summaryVmFactory,
Foundation.Orders.Model.Order item,
decimal defaultAmount)
{
InnerModel = new CreateRefundModel { Order = item, Amount = defaultAmount };
var itemParameter = new KeyValuePair<string, object>("item", InnerModel);
RegisterStep(detailsVmFactory.GetViewModelInstance(itemParameter));
RegisterStep(summaryVmFactory.GetViewModelInstance(itemParameter));
}
示例14: CreatePriceListAssignmentViewModel
public CreatePriceListAssignmentViewModel(
IViewModelsFactory<IPriceListAssignmentOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<IPriceListAssignmentSetConditionsStepViewModel> conditionsVmFactory,
IViewModelsFactory<IPriceListAssignmentSetDatesStepViewModel> datesVmFactory,
PricelistAssignment item)
{
RegisterStep(overviewVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
RegisterStep(conditionsVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
RegisterStep(datesVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
}
示例15: CreateCartPromotionViewModel
public CreateCartPromotionViewModel(
IViewModelsFactory<ICartPromotionOverviewStepViewModel> overviewVmFactory,
IViewModelsFactory<ICartPromotionExpressionStepViewModel> expressionVmFactory,
IViewModelsFactory<ICartPromotionCouponStepViewModel> couponVmFactory,
Promotion item)
{
RegisterStep(overviewVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
RegisterStep(expressionVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
RegisterStep(couponVmFactory.GetViewModelInstance(
new KeyValuePair<string, object>("item", item)));
}