SfSegmentedItem color properties are mostly ignored

Hi,

I have an SfSegmentedControl and its ItemSource is fed by an IValueConverter that returns an ObservableCollection<SfSegmentItem>.

It works quite well, the labels are shown according to the returned ObservableCollection, but other attributes (e.g.: SelectionBackgroundColor, SelectionTextColor, BackgroundColor, FontColor) are ignored, the control uses the default grey/blue color scheme.

The control is defined as:
            <buttons:SfSegmentedControl
                x:Name="PositionCtrl"
                Grid.Row="2"
                SelectedIndex="{Binding sfscval, Converter={x:Static pages:positionTosfscvalConverter}, Mode=TwoWay}"
                HorizontalOptions="CenterAndExpand"
                VerticalOptions="Start"
                VisibleSegmentsCount="2"
                BackgroundColor="Transparent"
                CornerRadius="10"
                HeightRequest="40"
                SegmentHeight="35"
                ItemsSource="{Binding sfsctype, Converter={StaticResource sfscToSfSegmentListConverter}}"/>

and the return value of IValueConverter is defined as:

private static ObservableCollection<SfSegmentItem> itemlist = new ObservableCollection<SfSegmentItem>()
        {
            new Syncfusion.XForms.Buttons.SfSegmentItem()
            {
                Text = "Text1",
                SelectionBackgroundColor = Color.LawnGreen,
                SelectionTextColor = Color.White,
                BackgroundColor = Color.DarkGray,
                FontColor = Color.White
            },
            new Syncfusion.XForms.Buttons.SfSegmentItem()
            {
                Text = "Text2",
                SelectionBackgroundColor = Color.IndianRed,
                SelectionTextColor = Color.White,
                BackgroundColor = Color.DarkGray,
                FontColor = Color.White
            },
        };

What's wrong with it, why are the color attributes ignored?

TIA


1 Reply

PA Paul Anderson S Syncfusion Team October 4, 2018 12:47 PM UTC

Hi Peter, 
 
Greetings from Syncfusion. 
 
We have prepared a sample based on your requirement, in which the BackgroundColor for the SfSegmentedItem worked as expected. Please download the sample from the link given below. 
 
 
The SelectionBackgroundColor, SelectionTextColor, FontColor properties are not working as expected, hence we have reported bug for the same, the fix for this will be available in our Volume 3 Service pack 1, which is expected to be rolled out by the end of October 2018. 
 
Please let us know if you have any concern about this. 
 
Regards, 
Paul Anderson 


Loader.
Up arrow icon