DottorPagliaccius / Xamarin-Custom-Controls

in progress
MIT License
96 stars 34 forks source link

Accordion in ListView #1

Closed AntonioParrotta closed 7 years ago

AntonioParrotta commented 7 years ago

Hi, I'm trying to implement your AccordionView into my project. I downloaded it from nuget and it worked fine. But I would like to use it dynamically via ListView. I couldn't find out how to implement the ListView with the AccordionView as child element. I only get the first element but when I click on the item it does not expand.

Could you maybe give me some information how I can achieve this?

DottorPagliaccius commented 7 years ago

Ciao Anto'! Uhm... I'm not sure of what you're trying to do. Although this is not the intended use, I think you can place AccordionViewItem (not the AccordionView itself) in ListView TemplateItem, however you lose the mutually exclusive open/close feature (you can still set that manually, if you need).

You can still have the same effect populating AccordionView's children by code (not my fav way).

Saluti, Dr. P.

AntonioParrotta commented 7 years ago

Good morning Dr. P,

thanks for your reply. Maybe I could descripe my issue better with an example. In my application I want to create student instances through a button (like a "+" button or something like that). The students have a few fields like name, age ... . Only the names of the students should then appear on the display as a list. When the user clicks on a students name, this item should expand and show the remaining values like age and so on. My problem is that I cannot add the students at runtime and keep the accordion effect. I tried to put the AccordionViewItem into the ListView, but it didn't work. If I find a solution for this, I'll let you know.

Saluti, Toni

pfaucon commented 7 years ago

a bit late on the reply, but if you have a + button the normal UX expectation is a transition to a new page where you will define the new item (student). After completion you would add the new item to your data store, and return to the list and refresh the items

DottorPagliaccius commented 7 years ago

Check out the new version of AccordionView (AccordionRepeaterView), now it is bindable.