dotnethaggis
dotnethaggis

Reputation: 999

Xamarin Forms - what control to use to achieve...?

This will probably be a simple question to answer.

Collection of X where X has a property that's another collection. For example each object represents a day which has a collection property that represents entries for that day. So I want it to iterate through each day, and for each day I want it to iterate through each of the day's entries. So you would have the following on screen:

Tuesday 15th January

Entry 1
Entry 1's Description
Horizontal Image gallery scroll (one row)

Entry 2
Entry 2's Description
Horizontal Image gallery scroll (one row)

Wednesday 16th January

Entry 1
Entry 1's Description
Horizontal Image gallery scroll (one row)

Entry 2
Entry 2's Description
Horizontal Image gallery scroll (one row)

Entry 3
Entry 3's Description
Horizontal Image gallery scroll (one row)

Straight forward... I've managed to get the above (minus the image gallery) using a ListView (Grouped), however I don't want each Day / Day Entry to be clickable. Only thing that should be clickable are the images to display they full screen.

I've used the RepeaterView in Labs, however it doesn't seem to allow Grouping nor nested collections...

Any pointers would be much appreciated. I know what I want to do, I know how I would do it in other platforms (non mobile), but don't know how to do it in this new Xamarin Forms world...

Upvotes: 0

Views: 74

Answers (2)

Maestro1024
Maestro1024

Reputation: 3293

This is a listview for the main view. And use a stack layout for the cells. Set the Orientation to Vertical.

   return new ViewCell
   {
        View = new StackLayout
        {
            Orientation = StackOrientation.Vertical,

Upvotes: 0

eakgul
eakgul

Reputation: 3698

You might want yo use ListView. It allows to grouping data. You can also customize the cells.

Upvotes: 1

Related Questions