Xamarin-Forms - Listview expansive

Asked

Viewed 86 times

1

I have a database to create a menu, in this I have three tables:
1 - Types of menu
2 - Groups of the menu
3 - Menu options

This database will be updated and consulted by a WEB API that has already been developed in ASP.NET CORE, that is, it is already running. Now I am modeling an application and I would like to know if with Xamarin Forms it is possible to create a listview that displays the options grouped according to the information of each table and only displays the complete list when touching one of the menu types. For example:

MEALS (table 1 - menu types)
SELF (table 2 - menu groups)
SELF-SERVICE (table 3 - menu options)

DAILY DISHES (Table 2 - Menu groups)
SEGUNDA - VIRADO A PAULISTA (table 3 - menu options)
TUESDAY - STEAK/CHICKEN PARMIGIANA (table 3 - menu options)
FOURTH - FEIJOADA (table 3 - menu options)
THURSDAY - LASAGNA (table 3 - menu options)
FRIDAY - FISH WITH MASHED POTATOES (table 3 - menu options)

DRINKS (table 1 - menu types)
SOFT DRINKS (Table 2 - Menu groups)
SODA CAN (table 3 - menu options)
SOFT DRINK 1.5L (table 3 - menu options)

JUICES (table 2 - menu groups)
NATURAL JUICE (GLASS) (table 3 - menu options)
NATURAL JUICE (JUG) (table 3 - menu options)

Thanks for your help.

Classes I use in the API:

public class TipoCardapio
{
    [Key]
    public int TipoId { get; set; }
    [MaxLength(30)]
    public string Descricao { get; set; }
    public virtual ICollection<GruposDoCardapio> GruposDoCardapios { get; set; }
    public virtual ICollection<OpcoesDoCardapio> OpcoesDoCardapios { get; set; }

}

public class GruposDoCardapio
{
    [Key]
    public int GrupoId { get; set; }
    [MaxLength(30)]
    public string Descricao { get; set; }
    public string Notas { get; set; }
    public virtual TipoCardapio TipoCardapios { get; set; }
    public virtual ICollection<OpcoesDoCardapio> OpcoesDoCardapios { get; set; }
}

public class OpcoesDoCardapio
{
    public int Id { get; set; }
    [MaxLength(11)]
    public string DiaDaSemana { get; set; }
    [MaxLength(35)]
    public string Descricao { get; set; }
    [Column(TypeName = "decimal(18,2)")]
    public decimal Valor { get; set; }
    public virtual TipoCardapio TipoCardapios { get; set; }
    public virtual GruposDoCardapio GruposDoCardapios { get; set; }

}

Imagery: Modelo 1 - Cardápio

Modelo 2 - Cardápio

1 answer

1

I believe Expandable listview is what you want. Look at this Link and if it helps you.

  • Thank you for the reply @Briansouza ... I will take a look at the link material, analyze the code and find the best way to adapt my need.

  • If anyone else is looking, I found this link interesting.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.