Alter List Item while Binding



Step 1

              add needed paramenter to required list

step 2

             Use that paramenter to bind in list item source

--------------------------

       if (result.listdata!= null)
                            {
                               
                                List<TrackList> objlist = new List<TrackList>();
                                foreach (var item in result.listdata)
                                {
                                    TrackList _templist = new TrackList();
                                    _templist.id = item.id;
                                    _templist.name = item.track_name;
                                    _templistdescription = item.track_description;
                                    _templist.is_recommended = item.is_recommended;
                                    if (item.is_recommended  == "1")
                                    {
                                        _templist.is_neded = true;
                                    }
                                    else
                                    {
                                        _templist.is_neded = false;
                                    }
                                    objlist.Add(_templist);
                                }

                                UserDialogs.Instance.HideLoading();
                                TrackListItemSource = objlist;



                            }

Comments

Popular posts from this blog

Listview SelectedItem in MVVM

Button click event with current object from listview having button

SideMenu React native