- Home
- Forum
- Xamarin.Forms
- SfTabView TabItemCollection, ListView And MVVM
SfTabView TabItemCollection, ListView And MVVM
Hello,
my goal is to create a page with a SfTabView control having a dynamic number of SfTabItem, read from a SQLite local database.Each SfTabItem has a custom header a a ListView as content. The page is binded with a ViewModel, in which I loop the data and create the SfTabItems.
I succesfully created the page structure, I can read from the database and populate the tabview control with a TabItemCollection field of the ViewModel. My problem is that when I try to add an ItemTapped event to the listview, nothing gets called. I tried everything: ItemTapped event, SelectedItem property, EventToCommandBehavior attached, gestures, ...
Attached to this post there's an excerpt
of my code, containing the relative part of the issue. The weird thing
is that in this code the ItemTapped event is correctly fired, while the
SelectionChanged event on the SfTabView is not fired.
How can I obtain my goal correctly? Am I missing something?
I hoped there were something like this for SfTabView control, but no luck...
Thanks in advance,
Matteo
Attachment: Test_6c0a23fc.zip
SIGN IN To post a reply.
3 Replies
PA
Paul Anderson S
Syncfusion Team
December 18, 2018 12:31 PM UTC
Hi Matteo,
Greetings from Syncfusion.
Query 1: SelectionChanged event on the SfTabView is not fired.
We have already faced the reported issue in the older versions and this issue has been fixed in the latest version (16.4.0.42). So please upgrade to the latest version (16.4.0.42) to resolve this issue.
Query 2: I hoped there were something like SfTabControl.
Your requirement can be achieved by using the SelectionColor and selection indicator’s position property. When analyzing the given sample, we found that you have used custom tab header view for all tab headers. When using custom tab header view, the SelectionColor and selection indicator’s position properties won’t apply. So, your requirement can be achieved only when using normal tab header. We have prepared the sample based on your requirement. Please have the sample from the below link.
Please check the sample and let us know if you have any concerns. Also, please tell us for what purpose you have used custom tab header view.
Query 3: ItemTapped event of the listview is not called.
We are unable to reproduce the reported issue from our side. We prepared the sample to show that the events are fired correctly. Please have the sample from the below link.
Please check the sample and if the issue still persists in your side, please modify the sample as per your scenario so that we can reproduce the issue and help you in resolving the issue at your end.
Regards,
Paul Anderson
MC
Matteo Comi
December 18, 2018 06:10 PM UTC
Hi Paul,
I solved my issue.
Thanks,
Matteo
PA
Paul Anderson S
Syncfusion Team
December 19, 2018 04:00 AM UTC
Hi Matteo,
Thanks for the update. We are glad that your reported issue has been resolved. Please get in touch if you required further assistance.
Regards,
Paul Anderson
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
MC Matteo Comi
- Dec 17, 2018 01:05 PM UTC
- Dec 19, 2018 04:00 AM UTC