public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView ?? context.LayoutInflater.Inflate(Resource.Layout.ModeloListView, parent, false);

            var txtId   = view.FindViewById <TextView>(Resource.Id.txtId);
            var txtNome = view.FindViewById <TextView>(Resource.Id.txtNome);
            var btEd    = view.FindViewById <ImageButton>(Resource.Id.imgEdit);
            var btDel   = view.FindViewById <ImageButton>(Resource.Id.imgDel);

            //preencher os campos
            txtNome.Text = usuario[position].NOME_US;
            txtId.Text   = usuario[position].ID_US.ToString();

            btDel.Click += (sender, arg) =>
            {
                //Aplica Interface
                delete.onDelete(txtId.Text);
            };

            //Update
            btEd.Click += (sender, arg) =>
            {
                //
                Update.onUpdate(txtId.Text);
            };

            return(view);
        }
Beispiel #2
0
        /*
         * SOBRECARREGA
         *
         *  GetView – Retorna uma View para cada linha,
         *  preenchida com elemento do xml
         *
         */

        public override View GetView(int position, View convertView,
                                     ViewGroup parent)
        {
            // layout que tem o modelo do intem com sera mostrado

            var view = convertView ?? context.LayoutInflater.Inflate(
                Resource.Layout.ModeloListView, parent, false);

            var txtid   = view.FindViewById <TextView>(Resource.Id.txtid);
            var txtNome = view.FindViewById <TextView>(Resource.Id.txtNome);
            var btEd    = view.FindViewById <ImageButton>(Resource.Id.imgEdit);
            var btDel   = view.FindViewById <ImageButton>(Resource.Id.imgDel);

            // preencher os campo
            txtNome.Text = usuario[position].NOME_US;
            txtid.Text   = usuario[position].ID_US.ToString();


            btDel.Click += (sender, arg) =>
            {
                // APLICA INTERFACE
                delete.onDelete(txtid.Text);
            };

            //UPDATE
            btEd.Click += (sender, arg) =>
            {
                //
                Update.onUpdate(txtid.Text);
            };



            return(view);
        }