示例#1
0
        void MessageListenerr()
        {
            var Mee = DataBase.MEMBER_DATA_GETIR()[0];

            new System.Threading.Thread(new System.Threading.ThreadStart(delegate
            {
                _timer = new System.Threading.Timer((o) =>
                {
                    try
                    {
                        var Durum = MesajlariGetir();
                        InvokeOnMainThread(() =>
                        {
                            if (Durum) //İçerik  Değişmişse Uygula
                            {
                                //ChatTableView.TranslatesAutoresizingMaskIntoConstraints = false;

                                ChatTableView.AllowsSelection = false;
                                ChatTableView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                                ChatTableView.RegisterClassForCellReuse(typeof(IncomingCell), IncomingCell.CellId);
                                ChatTableView.RegisterClassForCellReuse(typeof(OutgoingCell), OutgoingCell.CellId);
                                ChatTableView.RegisterClassForCellReuse(typeof(OutgoingCell_Resim), OutgoingCell_Resim.CellId);
                                ChatTableView.RegisterClassForCellReuse(typeof(IncomingCell_Resim), IncomingCell_Resim.CellId);
                                //View.AddSubview(tableView);
                                ChatTableView.Source = new ChatCustomTableCellSoruce(ChatDetayDTO1, this, Mee);
                                ChatTableView.ReloadData();
                                if (ChatDetayDTO1.Count > 0)
                                {
                                    var bottomIndexPath = NSIndexPath.FromRowSection(ChatTableView.NumberOfRowsInSection(0) - 1, 0);
                                    ChatTableView.ScrollToRow(bottomIndexPath, UITableViewScrollPosition.Bottom, true);
                                }

                                //ChatTableView.Source = new ChatCustomTableCellSoruce(ChatDetayDTO1, this, Mee);
                                ChatTableView.BackgroundColor = UIColor.Clear;
                                //ChatTableView.RowHeight = UITableView.AutomaticDimension;
                                //ChatTableView.EstimatedRowHeight = 100f;
                                //ChatTableView.ReloadData();
                                //ChatTableView.AllowsSelection = false;
                                //if (ChatDetayDTO1.Count > 0)
                                //{
                                //    var bottomIndexPath = NSIndexPath.FromRowSection(ChatTableView.NumberOfRowsInSection(0) - 1, 0);
                                //    ChatTableView.ScrollToRow(bottomIndexPath, UITableViewScrollPosition.Bottom, true);
                                //}
                                MesajOkunduYap();
                            }
                        });
                    }
                    catch
                    {
                    }
                }, null, 0, 3000);
            })).Start();
        }
示例#2
0
 private void KeyboardDidShow(NSNotification notification)
 {
     if (ChatDetayDTO1.Count > 0)
     {
         var bottomIndexPath = NSIndexPath.FromRowSection(ChatTableView.NumberOfRowsInSection(0) - 1, 0);
         try
         {
             ChatTableView.ScrollToRow(bottomIndexPath, UITableViewScrollPosition.Bottom, true);
         }
         catch
         {
         }
     }
 }