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