예제 #1
0
		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();
		}
		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();
		}
예제 #3
0
		public MainHomeViewModel(IAppConfigRepository repository, NavigationManager navManager, TileManager tileManager, ILoginViewModel loginViewModel)
		{
			_repository = repository;
			_tileManager = tileManager;
			_navManager = navManager;
			_loginViewModel = loginViewModel;

			PopulateTiles();
			CommandsInit();
		}
예제 #4
0
		public ShellViewModel()
		{
			_regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
			_navigationManager = ServiceLocator.Current.GetInstance<NavigationManager>();
			CommandInit();
			OnUIThread(() => OnPropertyChanged("IsMainMenuVisible"));
			RiseWindowResizeCommand();
			var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
			container.RegisterType<IGlobalConfigService, GlobalConfigService>(new ContainerControlledLifetimeManager());
			EventSystem.Subscribe<ShellMessageEvent>((mess) => OnUIThread(() =>
				{
					NumAssignedCases = mess.Message == "0" ? "" : mess.Message;
				}));
		}
		public ConfigurationViewModel(
			IProjectLocationStepViewModel projectLocationViewModel,
			IDatabaseSettingsStepViewModel databaseViewModel,
			ISearchSettingsStepViewModel searchViewModel,
			NavigationManager navigationManager)
		{
			_projectLocationStepViewModel = projectLocationViewModel;
			_projectLocationStepViewModel.Configuration = this;
			_databaseSettingsStepViewModel = databaseViewModel;
			_databaseSettingsStepViewModel.Configuration = this;
			_searchSettingsStepViewModel = searchViewModel;
			_searchSettingsStepViewModel.Configuration = this;

			_navigationManager = navigationManager;

			Initialize();
		}
        public CustomersDetailViewModel(ICustomerEntityFactory entityFactory, ICustomerRepository repository,
                    NavigationManager navManager, IRepositoryFactory<ICustomerRepository> repositoryFactory,
                    IAuthenticationContext authContext, ICustomersCommonViewModel parentViewModel,
                    Case innerCase, Contact innerContact,
                    CaseActionState caseAction, ContactActionState contactAction,
                    IViewModelsFactory<CaseDetailViewModel> caseDetailVmFactory, IViewModelsFactory<CustomerDetailViewModel> customerDetailVmFactory,
                    IViewModelsFactory<ICreateCustomerDialogViewModel> wizardCustomerVmFactory,
                    IViewModelsFactory<IKnowledgeBaseDialogViewModel> knowledgeBaseGroupVmFactory)
        {
            _entityFactory = entityFactory;
            Repository = repository;
            _authContext = authContext;
            _navManager = navManager;
            _repositoryFactory = repositoryFactory;
            _caseDetailVmFactory = caseDetailVmFactory;
            _customerDetailVmFactory = customerDetailVmFactory;
            _wizardCustomerVmFactory = wizardCustomerVmFactory;
            _knowledgeBaseGroupVmFactory = knowledgeBaseGroupVmFactory;
            _parentViewModel = parentViewModel;

            OriginalItem = innerCase;
            OriginalContact = innerContact;

            InnerItem = innerCase;
            CurrentCustomer = innerContact;

            CaseActionState = caseAction;
            ContactActionState = contactAction;

            InitializeCommands();

            _isItemsInitialized = false;

            ViewTitle = new ViewTitleBase
                {
                    SubTitle = string.Format("Case #{0}".Localize(), InnerItem.Number),
                    Title = "Customer Service"
                };


            _authorId = _authContext.CurrentUserId;
            _authorName = _authContext.CurrentUserName;
        }
예제 #7
0
		public ShellViewModel()
		{
			_regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
			_navigationManager = ServiceLocator.Current.GetInstance<NavigationManager>();
			CommandInit();
			OnUIThread(() => OnPropertyChanged("IsMainMenuVisible"));
			RiseWindowResizeCommand();
			var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
			container.RegisterType<IGlobalConfigService, GlobalConfigService>(new ContainerControlledLifetimeManager());
            // subscribe to custommers service messages
			EventSystem.Subscribe<ShellMessageEvent>((mess) => OnUIThread(() =>
				{
					NumAssignedCases = mess.Message == "0" ? "" : mess.Message;
				}));
            // subscribe to GUI languages messages
			EventSystem.Subscribe<GenericEvent<Tuple<List<CultureInfo>, Action<string>>>>(xx => OnUIThread(() =>
			{
				AvailableGuiCultures.Clear();

				xx.Message.Item1.ForEach(x =>
					{
						AvailableGuiCultures.Add(x);
					});
				if (AvailableGuiCultures.All(x => x.Name != "en-US"))
				{
					AvailableGuiCultures.Insert(0, CultureInfo.GetCultureInfo("en-US"));
				}

				if (AvailableGuiCultures.All(x => x.Name != System.Threading.Thread.CurrentThread.CurrentUICulture.Name))
				{
					CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
				}
				GuiCulture = System.Threading.Thread.CurrentThread.CurrentUICulture.ThreeLetterWindowsLanguageName;
				ChangeLanguageAction = xx.Message.Item2;

				// perform other initialization as Localization module has initialized.
				if (StatusIndicatorVM == null)
					StatusIndicatorVM = StatusIndicatorViewModel.GetInstance();
			}));
		}
		public CatalogModule(IUnityContainer container, IAuthenticationContext authContext, NavigationManager navManager)
		{
			_container = container;
			_authContext = authContext;
			_navManager = navManager;
		}
예제 #9
0
 public SecurityModule(IUnityContainer container, NavigationManager navigationmanager)
 {
     _container = container;
     _navigationManager = navigationmanager;
 }
 public ConfigurationHomeViewModel(NavigationManager navigationManager)
 {
     _navigationManager = navigationManager;
     ViewTitle = new ViewTitleBase { Title = "Settings" };
 }
예제 #11
0
		public ReviewsModule(IUnityContainer container, IRegionManager regionManager, NavigationManager navigationManager)
        {
            _container = container;
            _regionManager = regionManager; 
            _navigationManager = navigationManager;
        }