We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfTabView TabItemCollection, ListView And MVVM

Thread ID:

Created:

Updated:

Platform:

Replies:

141542 Dec 17,2018 01:05 PM UTC Dec 19,2018 04:00 AM UTC Xamarin.Forms 3
loading
Tags: SfTabView
Matteo Comi
Asked On December 17, 2018 01:05 PM UTC

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

Paul Anderson S [Syncfusion]
Replied On 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 


Matteo Comi
Replied On December 18, 2018 06:10 PM UTC

Hi Paul,
I solved my issue.

Thanks,
Matteo

Paul Anderson S [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;