Пример #1
0
        public DirectorListViewModel(IMediator mediator,
                                     IWarningService warningService,
                                     DirectorFacade facade)
        {
            usedMediator       = mediator;
            usedWarningService = warningService;
            usedFacade         = facade;

            mediator.Register <YES_WarningResultMessage <DirectorWrappedModel> >(DeleteDirector);
            mediator.Register <NO_WarningResultMessage <DirectorWrappedModel> >(UpdateDirectors);
            mediator.Register <UpdateMessage <DirectorWrappedModel> >(UpdateDirectors);

            DirectorSelectedCommand = new RelayCommand <DirectorListModel>(SendDirectorSelectedMessage);
            AddButtonCommand        = new RelayCommand(SendDirectorNewMessage);
            DeleteButtonCommand     = new RelayCommand(ExecuteWarning, IsEnabled_DeleteDetailButton);
            DetailButtonCommand     = new RelayCommand(SendDetailButtonPushedMessage, IsEnabled_DeleteDetailButton);
            RefreshButtonCommand    = new RelayCommand(Refresh);
            SearchButtonCommand     = new RelayCommand(StartSearching);

            SearchedObject   = defaultSearchingBoxMessage;
            SearchingOptions = new List <string>()
            {
                "First name", "Second name"
            };
            SelectedOption = SearchingOptions[1];

            Load();
        }
Пример #2
0
        public DirectorFacadeTests()
        {
            var dbContextFactory = new DbContextInMemoryFactory(nameof(ActorFacadeTest));
            var unitOfWork       = new UnitOfWork(dbContextFactory);

            repository = new Repository <DirectorEntity>(unitOfWork);
            mapper     = new DirectorMapper();

            facadeTestUnit = new DirectorFacade(unitOfWork, repository, mapper);
        }
Пример #3
0
        public SelectDirectorViewModel(IMediator mediator,
                                       DirectorFacade facade)
        {
            usedMediator = mediator;
            usedFacade   = facade;

            usedMediator.Register <DeleteMessage <DirectorWrappedModel> >(ReloadList);
            usedMediator.Register <UpdateMessage <DirectorWrappedModel> >(ReloadList);

            ItemSelectedCommand = new RelayCommand <DirectorListModel>(ItemSelected);

            LoadList();
        }
Пример #4
0
        public DirectorDetailViewModel(IMediator mediator,
                                       DirectorFacade directorFacade,
                                       IFileBrowserService fileBrowserSerice,
                                       IOpenWebPageService openWebPageService)
        {
            usedMediator           = mediator;
            usedDirectorFacade     = directorFacade;
            usedFileBrowserService = fileBrowserSerice;
            usedOpenWebPageService = openWebPageService;

            usedMediator.Register <NewMessage <DirectorWrappedModel> >(CreateNewWrappedModel);
            usedMediator.Register <SelectedMessage <DirectorWrappedModel> >(PrepareDirector);
            usedMediator.Register <MoveToDetailMessage <DirectorWrappedModel> >(ShowDetailInfo);

            FilmSelectedCommand      = new RelayCommand <FilmDirectorWrappedModel>(MoveToFilmDetail);
            EditButtonCommand        = new RelayCommand(EnableTextEditing);
            SaveButtonCommand        = new RelayCommand(Save, CanSave);
            UpdatePhotoButtonCommand = new RelayCommand(UpdatePhoto, UpdatePhotoEnabled);
            OpenWikiButtonCommand    = new RelayCommand(OpenWiki, OpenWikiEnabled);
        }
Пример #5
0
        public HomeViewModel(IMediator mediator,
                             FilmFacade filmFacade,
                             ActorFacade actorFacade,
                             DirectorFacade directorFacade)
        {
            usedMediator       = mediator;
            usedFilmFacade     = filmFacade;
            usedActorFacade    = actorFacade;
            usedDirectorFacade = directorFacade;

            SearchButtonCommand = new RelayCommand(StartSearching);
            FoundItemSelected   = new RelayCommand <FoundItem>(ShowDetail);
            CloseListCommand    = new RelayCommand(HideFoundItems);

            SearchedObject   = defaultSearchingBoxMessage;
            SearchingOptions = new List <string>()
            {
                "All", "Films", "Actors", "Directors"
            };
            SelectedOption = SearchingOptions[0];
            IsVisible      = false;
        }