Ejemplo n.º 1
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);
        }
 /// <summary>
 ///     Performs navigation to the previously specified ViewModel with the list of parameters
 ///     specified with <see cref="WithParam{TValue}(Expression{Func{TViewModel, TValue}}, TValue)"/>
 ///     and <see cref="WithParams(IEnumerable{NavigationParameterModel})"/> methods.
 /// </summary>
 /// <param name="clearBackStack">
 ///     Boolean value indicating if this service should clear backstack after the navigation is performed.
 /// </param>
 public void Navigate(bool clearBackStack = false)
 {
     _navigationService.NavigateToViewModel <TViewModel>(clearBackStack, Parameters);
 }