Exemplo n.º 1
0
        public AddContactsViewModel(
            IChatAuthService authService,
            IChatLocalizedStrings chatLocalizedStrings)
        {
            _authService    = authService;
            Resources       = chatLocalizedStrings;
            NoResultVisible = false;

            PaginationViewModel = new PaginationViewModel <ChatUserViewModel, ChatUserModel>(
                new ChatUserViewModelFactory(),
                SearchLoader,
                SearchFilter,
                DefaultSearchResultsPageSize);

            _contactSelectedCommand = new RelayCommand <ChatUserViewModel>(SwitchSelectedContact);
            SearchContactCommand    = new RelayCommand(DoSearch);
            CancelCommand           = new RelayCommand(() => DialogComponent.CloseCommand.Execute(null));
            DoneCommand             = new RelayCommand(() => DialogComponent.CloseCommand.Execute(SelectedContacts));
        }
Exemplo n.º 2
0
        public NewChatViewModel(
            IChatService chatService,
            IChatsListManager chatsListManager,
            IChatLocalizedStrings localizedStrings,
            IPageNavigationService pageNavigationService,
            ILogManager logManager)
        {
            _searchContactsStrategy = new CreateChatSearchContactsStrategy(chatService);
            _chatsListManager       = chatsListManager;
            LocalizedStrings        = localizedStrings;
            _pageNavigationService  = pageNavigationService;
            _logger         = logManager.GetLogger <NewChatViewModel>();
            NoResultVisible = false;

            PaginationViewModel = new PaginationViewModel <ChatUserViewModel, ChatUserModel>(
                new ChatUserViewModelFactory(),
                SearchLoader,
                SearchFilter,
                DefaultSearchResultsPageSize);
            SearchCommand             = new AsyncCommand(DoSearch);
            CancelCommand             = new RelayCommand(GoBack);
            CreateGroupChatCommand    = new RelayCommand(() => _pageNavigationService.NavigateToViewModel <CreateChatViewModel>());
            CreatePersonalChatCommand = new RelayCommand <ChatUserViewModel>(CreatePersonalChat);
        }