コード例 #1
0
 public ClothesEditViewModelFactory(IEventAggregator eventAggregator, IRegionManager regionManager, IClothesServices clothesService, ITypesService typesService)
 {
     this.eventAggregator = eventAggregator;
     this.regionManager   = regionManager;
     this.clothesService  = clothesService;
     this.typesService    = typesService;
 }
コード例 #2
0
 public ClothesEditViewModel(IEventAggregator eventAggregator, IRegionManager regionManager, IClothesServices clothesService, ITypesService typesService, PieceOfClothing pieceOfClothing)
 {
     this.eventAggregator = eventAggregator;
     this.regionManager   = regionManager;
     this.clothesService  = clothesService;
     this.typesService    = typesService;
     CurrentItem          = pieceOfClothing;
     Initialize();
 }
コード例 #3
0
 public ClothesCreateViewModel(IEventAggregator eventAggregator, IRegionManager regionManager, IClothesServices clothesService, ITypesService typesService)
 {
     this.eventAggregator = eventAggregator;
     this.regionManager   = regionManager;
     this.clothesService  = clothesService;
     this.typesService    = typesService;
     //typesList = typesService.TypesList;
     TypesService_TypesListUpdated(this, null);
     typesService.TypesListUpdated += TypesService_TypesListUpdated;//unsubscribe on exit!!!!
     Initialize();
 }
コード例 #4
0
        public ClothesListViewModel(IClothesServices clothesService, IEventAggregator eventAggregator)
        {
            this.clothesService  = clothesService;
            this.eventAggregator = eventAggregator;
            eventAggregator.GetEvent <ClothesListUpdateRequestedEvent>().Subscribe(OnUpdateRequested, true);
            eventAggregator.GetEvent <FilteringConditionsChangedEvent>().Subscribe(OnFilterChanged, true);
            eventAggregator.GetEvent <SortingConditionsChangedEvent>().Subscribe(OnSortingConditionsChanged, true);
            eventAggregator.GetEvent <DatabaseConnectionErrorOccuredEvent>().Subscribe(OnDatabaseConnectionError, true);

            //Might be useful to use event aggregation in the future also for this
            clothesService.ClothesListUpdated += ClothesService_ClothesListUpdated;
            UpdateClothesList();
        }
コード例 #5
0
        public ClothesDetailsLowerButtonsBarViewModel(IEventAggregator eventAggregator, IClothesServices clothesService)
        {
            this.clothesService  = clothesService;
            this.eventAggregator = eventAggregator;

            DisplayDeleteConfirmation = false;
            InvokePropertyChanged("DisplayPreDeleteButton");

            timer          = new Timer(2000);
            timer.Elapsed += Timer_Elapsed;

            PieceOfClothingChangedEvent evt =
                eventAggregator.GetEvent <PieceOfClothingChangedEvent>();

            evt.Subscribe(OnCurrentItemChanged, true);
        }
コード例 #6
0
        public ClothesDetailsActionButtonsViewModel(IEventAggregator eventAggregator,
                                                    IUnityContainer container,
                                                    IRegionManager regionManager,
                                                    IClothesServices clothesService,
                                                    ClothesEditViewModelFactory viewModelFactory)
        {
            //Use the event aggregation to catch the newly selected item on the list
            this.eventAggregator = eventAggregator;
            PieceOfClothingChangedEvent evt =
                eventAggregator.GetEvent <PieceOfClothingChangedEvent>();

            evt.Subscribe(OnCurrentItemChanged, true);

            //Register the injected fields
            this.container            = container;
            this.regionManager        = regionManager;
            this.clothesService       = clothesService;
            this.editViewModelFactory = viewModelFactory;
        }