Пример #1
0
 public ConnectionStatusViewModel(
     IChatLocalizedStrings localizedStrings,
     IChatConnectionManager chatConnectionManager)
 {
     _localizedStrings      = localizedStrings;
     _chatConnectionManager = chatConnectionManager;
 }
Пример #2
0
 public CreateChatViewModel(
     IChatsListManager chatsListManager,
     IChatService chatService,
     IPageNavigationService pageNavigationService,
     IChatLocalizedStrings localizedStrings,
     IFormatService formatService,
     IUploadImageService uploadImageService,
     IDialogsService dialogsService)
 {
     _chatsListManager      = chatsListManager;
     _chatService           = chatService;
     _pageNavigationService = pageNavigationService;
     _formatService         = formatService;
     _uploadImageService    = uploadImageService;
     _dialogsService        = dialogsService;
     LocalizedStrings       = localizedStrings;
 }
        public ChatMessageInputViewModel(
            string chatId,
            ChatManager chatManager,
            IImagePickerService imagePicker,
            IChatLocalizedStrings localizedStrings)
        {
            _imagePicker      = imagePicker;
            _chatId           = chatId;
            _chatManager      = chatManager;
            _localizedStrings = localizedStrings;

            OpenCameraCommand    = new AsyncCommand(OnCameraOpenAsync);
            OpenGalleryCommand   = new AsyncCommand(OnGalleryOpenAsync);
            DeleteImageCommand   = new RelayCommand(OnDeleteImage);
            EditMessageCommand   = new RelayCommand <ChatMessageViewModel>(EditMessage);
            CancelEditingCommand = new RelayCommand(CancelEditing);
            SendMessageCommand   = new AsyncCommand(SendMessageAsync);
        }
Пример #4
0
        public ChatMessagesViewModel(
            IImagePickerService imagePicker,
            IPageNavigationService pageNavigationService,
            IChatLocalizedStrings localizedStrings,
            IFormatService formatService,
            ChatManager chatManager,
            ConnectionStatusViewModel connectionStatusViewModel)
        {
            _imagePicker           = imagePicker;
            _pageNavigationService = pageNavigationService;
            _localizedStrings      = localizedStrings;
            _formatService         = formatService;
            _chatManager           = chatManager;

            ConnectionStatus = connectionStatusViewModel;

            BackCommand     = new RelayCommand(_pageNavigationService.GoBack, () => _pageNavigationService.CanGoBack);
            ShowInfoCommand = new RelayCommand(ShowInfo);
        }
Пример #5
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));
        }
Пример #6
0
        public ChatsListViewModel(
            IPageNavigationService pageNavigationService,
            IDialogsService dialogsService,
            IChatLocalizedStrings localizedStrings,
            IChatsListManager chatsListManager,
            ConnectionStatusViewModel connectionStatusViewModel)
        {
            _pageNavigationService = pageNavigationService;
            _dialogsService        = dialogsService;
            _chatsListManager      = chatsListManager;

            LocalizedStrings          = localizedStrings;
            ConnectionStatusViewModel = connectionStatusViewModel;

            Chats = _chatsListManager.ChatsCollection;

            CreateChatCommand = new RelayCommand(CreateChat);
            LeaveChatCommand  = new AsyncCommand <ChatSummaryViewModel>(LeaveChatAsync);
            DeleteChatCommand = new AsyncCommand <ChatSummaryViewModel>(DeleteChatAsync);
        }
Пример #7
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);
        }