Create a CarouselView of Grids

nickcwilkinsnickcwilkins USMember ✭✭
edited October 2017 in Xamarin.Forms

I wrote some code to take a grid and populate it with the correct amount of cells to generate a calendar for a given month. Now I want to put those generated grids (so no grid would be identical) in a CarouselView (so the user would swipe in a direction and get the calendar for the previous or next month.

Tagged:

Answers

  • nickcwilkinsnickcwilkins USMember ✭✭

    So there's the DataTemplateSelector but really I don't want to simply bind to a template to some data, I want that template to have different elements (that I generate) depending on some data

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @nickcwilkins ,

    If I were you, I would have used the FlowListView (or XF ListView with horizontal scroll) inside the CarouselView control.
    This way it will allow me to create the Datatemplate as well as will allow me to bind to the data-sources for each month's data as well (simply allowing you -- different elements (that I generate)).

    Hope it makes sense.

    -- N Baua

  • nickcwilkinsnickcwilkins USMember ✭✭
    edited October 2017

    All those components still use the DataTemplate, so that doesn't really fix my problem. Unless I generate one for every single Calendar, which doesn't seem right. I think the best way to rephrase what I'm asking would be how can I modify part of a template based on a view model. The way I build the grids is by adding a bunch of viewcells to them in code, but when I attempt to use the carouselview I don't see anyway I can do that because each one is templated.

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @nickcwilkins ,

    I am not sure, why you are building the calendar control again, it seems to me of re-inventing a wheel.
    May be you sure have reason for the same, however unless you mention your intent or exact requirement, anything me or any other user posts here will look vague.

    -- N Baua

  • nickcwilkinsnickcwilkins USMember ✭✭
    Well the idea is that month to month the calendar would be different, so it gets built based on however many days are in the month, what day of the week the month starts on, etc., so i can define a datatemplate with 7 columns and about 6 rows, but the content of the grid would still need to be populated.
Sign In or Register to comment.