本文整理汇总了C#中IViewModelsFactory类的典型用法代码示例。如果您正苦于以下问题:C# IViewModelsFactory类的具体用法?C# IViewModelsFactory怎么用?C# IViewModelsFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IViewModelsFactory类属于命名空间,在下文中一共展示了IViewModelsFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CatalogPromotionViewModel
public CatalogPromotionViewModel(
IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory,
IRepositoryFactory<IMarketingRepository> repositoryFactory,
IRepositoryFactory<ICatalogRepository> catalogRepositoryFactory,
IRepositoryFactory<IPricelistRepository> pricelistRepositoryFactory,
IViewModelsFactory<ISearchCategoryViewModel> searchCategoryVmFactory,
IViewModelsFactory<ISearchItemViewModel> searchItemVmFactory,
IRepositoryFactory<IShippingRepository> shippingRepositoryFactory,
IMarketingEntityFactory entityFactory,
INavigationManager navManager,
Promotion item)
: base(appConfigRepositoryFactory, repositoryFactory, entityFactory, navManager, item, false, searchCategoryVmFactory, searchItemVmFactory, shippingRepositoryFactory)
{
_catalogRepositoryFactory = catalogRepositoryFactory;
_pricelistRepositoryFactory = pricelistRepositoryFactory;
ViewTitle = new ViewTitleBase
{
Title = "Promotion",
SubTitle =
(item != null && !string.IsNullOrEmpty(item.Name))
? item.Name.ToUpper(CultureInfo.InvariantCulture)
: string.Empty
};
}
示例2: PropertyEditViewModel
public PropertyEditViewModel(
IViewModelsFactory<IPickAssetViewModel> pickAssetVmFactory,
IViewModelsFactory<ISearchCategoryViewModel> searchCategoryVmFactory,
DynamicContentItemProperty item)
{
_pickAssetVmFactory = pickAssetVmFactory;
_searchCategoryVmFactory = searchCategoryVmFactory;
InnerItem = item;
var itemValueType = (PropertyValueType)InnerItem.ValueType;
IsShortStringValue = itemValueType == PropertyValueType.ShortString;
IsLongStringValue = itemValueType == PropertyValueType.LongString;
IsDecimalValue = itemValueType == PropertyValueType.Decimal;
IsIntegerValue = itemValueType == PropertyValueType.Integer;
IsBooleanValue = itemValueType == PropertyValueType.Boolean;
IsDateTimeValue = itemValueType == PropertyValueType.DateTime;
IsAssetValue = itemValueType == PropertyValueType.Image;
IsCategoryValue = itemValueType == PropertyValueType.Category;
if (IsAssetValue)
SelectedAssetDisplayName = InnerItem.LongTextValue;
if (IsCategoryValue)
SelectedCategoryName = InnerItem.Alias;
AssetPickCommand = new DelegateCommand(RaiseItemPickInteractionRequest);
CategoryPickCommand = new DelegateCommand(RaiseCategoryPickInteractionRequest);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
}
示例3: LabelsSettingsViewModel
public LabelsSettingsViewModel(IViewModelsFactory<ILabelViewModel> labelVmFactory, IRepositoryFactory<ICustomerRepository> repositoryFactory)
{
_repositoryFactory = repositoryFactory;
_labelVmFactory = labelVmFactory;
CommandsInit();
}
示例4: 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();
}
示例5: CustomerDetailViewModel
public CustomerDetailViewModel(ISecurityService securityService, IViewModelsFactory<IPhoneNumberDialogViewModel> phoneVmFactory, IViewModelsFactory<IEmailDialogViewModel> emailVmFactory, IViewModelsFactory<ICreateUserDialogViewModel> wizardUserVmFactory, IViewModelsFactory<IAddressDialogViewModel> addressVmFactory, ICustomerEntityFactory entityFactory,
IAuthenticationContext authContext, CustomersDetailViewModel parentViewModel, Contact innerContact,
ICustomerRepository customerRepository, IRepositoryFactory<ISecurityRepository> securityRepositoryFactory,
IRepositoryFactory<ICountryRepository> countryRepositoryFactory, IRepositoryFactory<IOrderRepository> orderRepositoryFactory, ILoginViewModel loginViewModel)
{
_securityService = securityService;
_loginViewModel = loginViewModel;
_parentViewModel = parentViewModel;
_authContext = authContext;
_customerRepository = customerRepository;
_orderRepositoryFactory = orderRepositoryFactory;
_securityRepositoryFactory = securityRepositoryFactory;
_countryRepositoryFactory = countryRepositoryFactory;
_entityFactory = entityFactory;
_addressVmFactory = addressVmFactory;
_wizardUserVmFactory = wizardUserVmFactory;
_emailVmFactory = emailVmFactory;
_phoneVmFactory = phoneVmFactory;
_fileDialogService = new FileDialogService();
InnerItem = innerContact;
InnerItem.PropertyChanged += _innerContact_PropertyChanged;
CommandsInit();
RequestInit();
CollectionInit();
HasCurrentContactLoginAndSuspendAccessCheck();
}
示例6: 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);
});
}
示例7: CatalogImportJobHomeViewModel
public CatalogImportJobHomeViewModel(
IRepositoryFactory<IImportRepository> importRepository,
IViewModelsFactory<ICreateImportJobViewModel> wizardVmFactory,
IViewModelsFactory<IImportJobRunViewModel> runVmFactory,
IViewModelsFactory<IImportJobViewModel> itemVmFactory,
IImportJobEntityFactory entityFactory,
IAuthenticationContext authContext,
IImportService importService,
SubTabsDefaultViewModel parentViewModel)
: base(importRepository, wizardVmFactory, runVmFactory, itemVmFactory, entityFactory, authContext, importService, parentViewModel)
{
AvailableImporters = new[]
{
ImportEntityType.Product,
ImportEntityType.Bundle,
ImportEntityType.Category,
ImportEntityType.Association,
ImportEntityType.DynamicKit,
ImportEntityType.Package,
ImportEntityType.Sku,
ImportEntityType.ItemRelation,
ImportEntityType.ItemAsset,
ImportEntityType.Seo
};
DefaultImporter = AvailableImporters.First().ToString();
}
示例8: 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];
}
示例9: MainFulfillmentViewModel
public MainFulfillmentViewModel(
IInventoryHomeViewModel inventoryVm,
IPicklistHomeViewModel picklistVm,
IRmaHomeViewModel rmaVm,
IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory,
IRepositoryFactory<IOrderRepository> orderRepositoryFactory,
IOrderService orderService,
IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" };
_inventoryHomeVm = inventoryVm;
_inventoryHomeVm.ParentViewModel = this;
_picklistHomeVm = picklistVm;
_picklistHomeVm.ParentViewModel = this;
_rmaHomeVm = rmaVm;
_rmaHomeVm.ParentViewModel = this;
_completeShipmentVmFactory = completeShipmentVmFactory;
_orderRepositoryFactory = orderRepositoryFactory;
_authContext = authContext;
_orderService = orderService;
PopulateTabItems();
CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
CommonNotifyRequest = new InteractionRequest<Notification>();
}
示例10: PickAssetViewModel
public PickAssetViewModel(IAssetService assetRepository,
IViewModelsFactory<IInputNameDialogViewModel> inputNameVmFactory)
{
_assetRepository = assetRepository;
_inputNameVmFactory = inputNameVmFactory;
AddressBarItems = new ObservableCollection<AssetEntitySearchViewModelBase>();
SelectedFolderItems = new ObservableCollection<AssetEntitySearchViewModelBase>();
CommonNotifyRequest = new InteractionRequest<Notification>();
OpenItemCommand = new DelegateCommand<object>(RaiseOpenItemRequest);
RefreshCommand = new DelegateCommand(LoadItems);
UploadCommand = new DelegateCommand(RaiseUploadRequest, () => ParentItem.Type == AssetType.Container || ParentItem.Type == AssetType.Folder);
CreateFolderCommand = new DelegateCommand(RaiseCreateFolderRequest);
RenameCommand = new DelegateCommand(RaiseRenameRequest);
DeleteCommand = new DelegateCommand(RaiseDeleteRequest);
ParentItem = new RootSearchViewModel(null);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
InputNameDialogRequest = new InteractionRequest<ConditionalConfirmation>();
AssetPickMode = true;
RootItemId = null;
}
示例11: PropertyValueBaseViewModel
public PropertyValueBaseViewModel(IViewModelsFactory<IPickAssetViewModel> vmFactory, PropertyAndPropertyValueBase item, string locale)
{
InnerItem = item;
_vmFactory = vmFactory;
_locale = locale;
if (InnerItem.IsEnum)
{
if (InnerItem.IsMultiValue)
{
foreach (var value in InnerItem.Values)
{
var propertyValue = InnerItem.Property.PropertyValues.FirstOrDefault(x => x.PropertyValueId == value.KeyValue);
if (propertyValue != null)
{
value.BooleanValue = propertyValue.BooleanValue;
value.DateTimeValue = propertyValue.DateTimeValue;
value.DecimalValue = propertyValue.DecimalValue;
value.IntegerValue = propertyValue.IntegerValue;
value.LongTextValue = propertyValue.LongTextValue;
value.ShortTextValue = propertyValue.ShortTextValue;
value.KeyValue = propertyValue.PropertyValueId;
}
}
}
var defaultView = CollectionViewSource.GetDefaultView(InnerItem.Property.PropertyValues);
defaultView.Filter = FilterPropertyValues;
}
SetVisibility();
AssetPickCommand = new DelegateCommand(RaiseAssetPickInteractionRequest);
AssetRemoveCommand = new DelegateCommand(RaiseAssetRemoveInteractionRequest);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
}
示例12: MainViewModel
public MainViewModel(
BootstrapperApplication installer,
Engine engine,
IViewModelsFactory<IOperationCompletedStepViewModel> completedStepVmFactory,
IViewModelsFactory<IInstallationStepViewModel> installationStepVmFactory,
NavigationManager navigationManager,
IViewModelsFactory<IOperationProgressStepViewModel> progressStepVmFactory,
IViewModelsFactory<IModificationStepViewModel> modificationStepVmFactory,
IViewModelsFactory<ILayoutStepViewModel> layoutVmFactory)
: this()
{
_completedStepVmFactory = completedStepVmFactory;
_installationStepVmFactory = installationStepVmFactory;
_navigationManager = navigationManager;
_progressStepVmFactory = progressStepVmFactory;
_modificationStepVmFactory = modificationStepVmFactory;
_layoutVmFactory = layoutVmFactory;
IsInitializing = true;
PropertyChanged += OnPropertyChanged;
Cancelled = false;
_installer = installer;
_engine = engine;
if (_installer.Command.Display == Display.Passive || _installer.Command.Display == Display.Full)
{
OnUIThread(() => Application.Current.MainWindow.Closing += OnClosing);
}
SubscribeToInstallationEvents();
}
示例13: 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());
}
示例14: 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];
}
示例15: 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;
}