public void updateHorizontalCards() { Services.Inmueble inmueble = new Services.Inmueble(); List <Entities.Inmueble> inmuebles = inmueble.TraerInmuebles(4); List <ImageCard> cards = new List <ImageCard>(); foreach (Entities.Inmueble _inmueble in inmuebles) { cards.Add(new ImageCard(_inmueble.Id, _inmueble.Uri, _inmueble.Title, _inmueble.Ubication, _inmueble.Stars)); } flowLayoutPanel2.Controls.Clear(); flowLayoutPanel2.AutoScroll = true; flowLayoutPanel2.FlowDirection = FlowDirection.LeftToRight; flowLayoutPanel2.WrapContents = false; foreach (Control control in cards) { flowLayoutPanel2.Controls.Add(control); } }
private void updateVerticalCards() { Services.Inmueble inmueble = new Services.Inmueble(); List <Entities.Inmueble> inmuebles = inmueble.TraerInmuebles(); List <Card> cards = new List <Card>(); foreach (Entities.Inmueble _inmueble in inmuebles) { cards.Add(new Card(_inmueble.Id, _inmueble.Uri, _inmueble.Title, _inmueble.Ubication, _inmueble.Description, _inmueble.Stars, false)); } flowLayoutPanel1.Controls.Clear(); flowLayoutPanel1.AutoScroll = true; flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; flowLayoutPanel1.WrapContents = false; flowLayoutPanel1.Height = cards.Count * 260; foreach (Control control in cards) { flowLayoutPanel1.Controls.Add(control); } }