Beispiel #1
0
        public List <Tile> InicializarPlatos(Categoria categoria)
        {
            platos = BBDDService.GetPlatosFromCategoria(categoria);
            List <Tile> tiles = new List <Tile>();
            int         index = 0;

            foreach (Plato item in platos)
            {
                Tile t = new Tile();
                t.Background = Brushes.Red;
                t.Height     = 289;
                t.Width      = 289;
                t.Margin     = new Thickness(15);
                t.Command    = CustomCommands.CargarInfoPlato;
                StackPanel sp = new StackPanel();
                Image      i  = new Image();
                i.Source = ImageConverter.LoadImage(item.imagenPlato);
                i.Width  = 200;
                TextBlock tb = new TextBlock();
                tb.Text  = item.nombrePlato;
                tb.Style = Application.Current.FindResource("FuenteYTamano") as Style;
                sp.Children.Add(i);
                sp.Children.Add(tb);
                t.Content = sp;
                t.Tag     = index;
                tiles.Add(t);
                index++;
            }
            return(tiles);
        }