Add custom style for segmentedcontrol in styles.xaml

Is it possible to set up custom styling for the SfSegmentedControl in Styles.xaml, to ensure that all controls used in my application are using the custom styling?

I was trying something like this, but I am not getting it right

    <Style TargetType="SfButtons:SfSegmentedControl">
        <Setter Property="TextStyle.TextColor" Value="{AppThemeBinding Light={StaticResource Red}, Dark={StaticResource Red}}" />
    </Style>

3 Replies 1 reply marked as answer

MH Mohamed Hasan Jahir Hussain Syncfusion Team October 31, 2024 12:35 PM UTC

Hi Art,


Thank you for contacting us. To set the text color for the `SfSegmentedControl`, you can define a style in the `Styles.xaml` file. Here’s an example of how to do this:


Styles.xaml:

<Style TargetType="button:SfSegmentedControl">
<Setter Property="TextStyle" Value="{button:SegmentTextStyle TextColor=Red, FontSize=20}" />
</Style>


Regards,

Mohamed Hasan J


Attachment: SegmentedControlStyle_e0f95be.zip

Marked as answer

AV Art Vandelay October 31, 2024 05:54 PM UTC

Thank you! That sorted it all out :)



VM Vidyalakshmi Mani Syncfusion Team November 1, 2024 11:25 AM UTC

Hi Art,


We are glad that your issue has been resolved! Please let us know if you need further assistance. As always, we are happy to help you out.


Regards,

Vidyalakshmi M.



Loader.
Up arrow icon