Event for Reselecting selected item

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>


1 Reply

VO Vishal Omprasad Syncfusion Team June 10, 2024 05:50 AM UTC

Hi Karro,

Regarding “event for reselecting selected item”:

As of now, the .NET MAUI SfSegmentedControl does not have Tapped event support, and we have logged feature request for the same.

We plan to implement this feature in any of our upcoming release. During the planning stage for each release cycle, we review all open features and identify implementations based on parameters such as product vision, technological feasibility, and customer interest. Please upvote this feature to prioritize it.

We will notify you when this feature is implemented. However, you can communicate with us regarding any open features at any time using our Feature Report page.

Feedback link: https://www.syncfusion.com/feedback/58478/provide-tapped-event-support-in-the-sfsegmentedcontrol

If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.

Thank you for your patience.

Regards,
Vishal O.


Loader.
Up arrow icon