Beispiel #1
0
        private void SetCollectionViewSource()
        {
            // _refreshControl = new MvxUIRefreshControl();

            _source             = new ChatListSource(TableView);
            TableView.Source    = _source;
            TableView.RowHeight = ItemHeight;
//            CustomersList.AddSubview(_refreshControl);

            _source.ItemsSource = ViewModel.ChatList;
            TableView.ReloadData();
        }
Beispiel #2
0
        private void SetupTableView()
        {
            Debug.WriteLine("PropertyChanged: ChatListCountINTableView: " + ViewModel.ChatList.Count);

            HasChats(true);

            var source = new ChatListSource(_tableView, ViewModel.ChatList, ViewModel.Actions);

            _tableView.Source = source;
            _tableView.ReloadData();

            source.ChatListActionsEvent -= OnSource_ChatListActionsEvent;
            source.ChatListActionsEvent += OnSource_ChatListActionsEvent;
        }
Beispiel #3
0
        public void LoadLocalPreviousMessages()
        {
            try
            {
                loadList = false;
                paginationModel.SkipRecords += 30;

                int PreviousListCount = ListChatsCon.Values.Sum(list => list.Count);
                ListChatsCon = ChatMessageRepository.GetChatMessagesForPageIndex(paginationModel, chatConversation.ChatId);
                int CurrentListCount = ListChatsCon.Values.Sum(list => list.Count);

                if (ListChatsCon != null && ListChatsCon.Count > 0)
                {
                    consolidatedList = new List <ListItem>();

                    foreach (var itemm in ListChatsCon)
                    {
                        DateItem dateItem = new DateItem();
                        dateItem.setDate(itemm.Key.ToShortDateString());
                        consolidatedList.Add(dateItem);

                        foreach (var general in itemm.Value)
                        {
                            GeneralItem generalItem = new GeneralItem();
                            generalItem.setChatMessagearray(general);
                            consolidatedList.Add(generalItem);
                        }
                    }


                    chatSource                     = new ChatListSource(consolidatedList, this);
                    tblChatList.Source             = chatSource;
                    chatSource.OpenImageViewEvent += ChatSource_EventHandler;
                    tblChatList.ReloadData();
                    ScrollToBottom(true);
                }
            }
            catch (Exception e)
            {
                //  Crashes.TrackError(e);
            }
        }
Beispiel #4
0
        public void LoadLocalLatestMessages()
        {
            try
            {
                loadList = false;
                if (chatConversation != null)
                {
                    consolidatedList = new List <ListItem>();
                    ListChatsCon     = ChatMessageRepository.GetChatMessagesForPageIndex(paginationModel, chatConversation.ChatId);
                    messages         = new List <Message>();
                    if (ListChatsCon != null && ListChatsCon.Count > 0)
                    {
                        foreach (var itemm in ListChatsCon)
                        {
                            DateItem dateItem = new DateItem();
                            dateItem.setDate(itemm.Key.ToShortDateString());
                            consolidatedList.Add(dateItem);
                            foreach (var general in itemm.Value)
                            {
                                GeneralItem generalItem = new GeneralItem();
                                generalItem.setChatMessagearray(general);
                                consolidatedList.Add(generalItem);
                            }
                        }
                        chatSource = new ChatListSource(consolidatedList, this);

                        tblChatList.Source             = chatSource;
                        chatSource.OpenImageViewEvent += ChatSource_OpenImageViewEvent;
                        tblChatList.Add(RefreshControl);

                        tblChatList.ReloadData();

                        ScrollToBottom(true);
                    }
                }
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }