private async void obtenerfundaciones() {

            fundaciones = new ObservableCollection<Fundacion>();

            var oFundaciones = await parseFun.AllFundaciones();
            if (oFundaciones != null)
            {
                Fundacion fun = new Fundacion();
                for (int i = 0; i < oFundaciones.Count(); i++)
                {
                    fun = new Fundacion();
                    var obj = oFundaciones.ElementAt(i) as ParseObject;
                    fun.Nombre = obj.Get<string>("nombre");
                    fun.Direccion = obj.Get<string>("direccion");
                    fun.Telefono = obj.Get<string>("telefono");
                    fun.Correo = obj.Get<string>("correo");
                    fun.Descripcion = obj.Get<string>("descripcion");
                    if (fun.Descripcion.Length > 100)
                        fun.Descripcion = fun.Descripcion.Substring(0, 100) + "...";
                    fun.Cuenta_bancaria = obj.Get<string>("cuenta_bancaria");
                    var a = obj.Get<ParseFile>("foto");
                    fun.Foto = a.Url.OriginalString;
                    fundaciones.Add(fun);
                    
                }
            }
           

            
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            item = e.Parameter as Fundacion;
            if (item.Nombre != null)
                nombre.Text = item.Nombre;
            if (item.Direccion != null)
                direccion.Text = item.Direccion;
            if (item.Correo != null)
                correo.Text = item.Correo;
            if (item.Telefono != null)
                telefono.Text = item.Telefono;
            if (item.Cuenta_bancaria != null)
                cuentaBancaria.Text = item.Cuenta_bancaria;

            if (item.Descripcion != null)
                descri.Text = item.Descripcion;

            if (item.Foto != null)
            {
                ImageBrush brush = new ImageBrush();
                brush.Stretch = Stretch.UniformToFill;

                BitmapImage image = new BitmapImage(new Uri(item.Foto));
                brush.ImageSource = image;

                foto.Fill = brush;
            }
        }
 private void agregarEvento()
 {
     Fundacion ob = new Fundacion();
     FundacionParse obp = new FundacionParse();
     ob.Correo = correo.Text;
     ob.Cuenta_bancaria = cuenta_bancaria.Text;
     ob.Descripcion = descripcion.Text;
     ob.Direccion = direccion.Text;
     ob.Nombre = nombre.Text;
     ob.Telefono = telefono.Text;
     obp.insertFundacion(ob);
     rootFrame.GoBack();
 }
        public async void updateFundacion(Fundacion fundacion)
        {
            ParseObject e = await FundacionById(fundacion.ObjectId);

            var stream = await fundacion.ArchivoImg.OpenAsync(FileAccessMode.Read);
            ParseFile fileP = new ParseFile(fundacion.ArchivoImg.Name, stream.AsStream());
            await fileP.SaveAsync();

            e["foto"] = fileP;
            e["nombre"] = fundacion.Nombre;
            e["direccion"] = fundacion.Direccion;
            e["descripcion"] = fundacion.Descripcion;
            e["cuenta_bancaria"] = fundacion.Cuenta_bancaria;
            e["correo"] = fundacion.Correo;
            e["telefono"] = fundacion.Telefono;
            await e.SaveAsync();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            itm = e.Parameter as Fundacion;
            nombre.Text = itm.Nombre;
            ImageBrush brush = new ImageBrush();
            brush.Stretch = Stretch.UniformToFill;


            BitmapImage image = new BitmapImage(new Uri(itm.Foto));
            brush.ImageSource = image;

            img.Fill = brush;
            direccion.Text = itm.Direccion;
            descripcion.Text = itm.Descripcion;
            cuenta_bancaria.Text = itm.Cuenta_bancaria;
            correo.Text = itm.Correo;
            telefono.Text = itm.Telefono;
     }