Hello,
in SfSegmentedControl I have a scenario where I need to get infromed if the user is interacting with the control, even if the user tapped on a selected item I have some logic to perform.
the "SelectionChanged" won't work because it will fire only if the selected index changed.
using TapGestureRecognizer is getting fired only if the user tapped on the controls border.
using community toolkits "TouchBehavior" is same as GestureRecognizer and fires only if tapped the border.
Any workaround on how to get informed if the user tapped on an already selected item?
Update:
I have achieved my requirment using datatemplate as below. But using this I have another issue, the datatemplate can not know if it is selected! and both
SelectionIndicatorSettings and TextStyle wont affect the content inside the data template!
<buttons:SfSegmentedControl.SegmentTemplate>
<DataTemplate x:DataType="buttons:SfSegmentItem">
<Label Text="{Binding Text}"
BackgroundColor="Transparent"
VerticalOptions="Fill"
HorizontalOptions="Fill"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center">
<Label.Behaviors>
<toolkit:TouchBehavior TouchGestureCompleted="SegmentItemTouched" />
</Label.Behaviors>
</Label>
</DataTemplate>
</buttons:SfSegmentedControl.SegmentTemplate>