table rows doesnt change after runoithread?

HalukmyHalukmy ✭✭TRMember ✭✭
edited July 2014 in Xamarin.iOS
this is my click and getcell code;

i want to show colors without change page with segue, is i tpossible to change ?

i tried runoithread but didint worked..

public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
            {
                UITableViewCell cell = tableView.DequeueReusableCell (cellIdentifier);

                var cellStlye = UITableViewCellStyle.Subtitle;
                if (cell == null) {
                    cell = new UITableViewCell (UITableViewCellStyle.Subtitle, cellIdentifier);
                }

                cell.TextLabel.Text = tableItemsX [indexPath.Row].MesajBasligi;
                cell.DetailTextLabel.Text = tableItemsX [indexPath.Row].CagriAcan;
                //  cell.Accessory = UITableViewCellAccessory.Checkmark;



                if (tableItemsX [indexPath.Row].Durum == true) {

                    cell.TextLabel.TextColor = UIColor.White;
                    cell.DetailTextLabel.TextColor = UIColor.White;
                    cell.BackgroundColor = UIColor.FromRGB (74, 160, 44);
                    cell.Accessory = UITableViewCellAccessory.Checkmark;
                    cell.TintColor = UIColor.FromRGB (43, 84, 126);

                } else {
                    cell.BackgroundColor = UIColor.FromRGB (43, 84, 126);
                    cell.Accessory = UITableViewCellAccessory.DetailButton;
                    cell.TextLabel.TextColor = UIColor.White;
                    cell.DetailTextLabel.TextColor = UIColor.White;
                    cell.TintColor = UIColor.FromRGB (74, 160, 44);

                }



                return cell;
            }



up.Process.Clicked += delegate {
                    new System.Threading.Thread (new System.Threading.ThreadStart (() => {
                        InvokeOnMainThread (() => {

                            bool state;

                            if (up.durumT.On)
                                state = true;
                            else
                                state = false;


                            var responseX = up.client.Post (new RequestUpdate {

                                Durum = state,

                                Gorulme = true,
                                TamamlanmaVakti = DateTime.Now,
                                YapilanIs = up.pesrsonelRaporu.Text,
                                CagriIlgilenen = up.sicil,
                                Id = conv

                            });



                            up.RequestListTable.ReloadData ();
                        });
                    })).Start ();

                };

Posts

Sign In or Register to comment.