public override View GetView(int position, View convertView, ViewGroup parent)
        {
            AreaModel area = SL.GetArea(position);

            //recycle a feed cell if possible for performance
            AreasCellHolder holder;
            View            view = convertView; // re-use an existing view, if one is available

            if (view == null)                   // otherwise create a new one
            {
                view = context.LayoutInflater.Inflate(Resource.Layout.areas_cell, null);

                //use a holder so we only need to find views and wire up the events once (wiring up events more than once would cause problems unless unsub from event handlers) for performance
                holder           = new AreasCellHolder();
                holder.AreaImage = view.FindViewById <ImageViewAsync>(Resource.Id.AreaImage);
                holder.AreaName  = view.FindViewById <TextView>(Resource.Id.AreaName);

                view.Tag = holder;
            }
            else
            {
                holder = view.Tag as AreasCellHolder;
            }

            holder.UpdateCellData(area);

            return(view);
        }
 public override AreaModel this[int position]
 {
     get
     {
         return(SL.GetArea(position));
     }
 }
Beispiel #3
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            AreaModel area = SL.GetArea(indexPath.Row);

            if (area != null)
            {
                SL.AreaGUID = area.areaGUID;
            }
        }
Beispiel #4
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            AreaModel area = SL.GetArea(indexPath.Row);

            SettingsNotificationsTableViewCell cell = (SettingsNotificationsTableViewCell)tableView.DequeueReusableCell(SettingsNotificationsTableViewCell.ClassName);

            cell.UpdateCellData(area);

            return(cell);
        }