Dear community,
this is the code I've populated my SegmentedControl:
List<string> source = new List<string>();
if(item.Pfad == nameof(Haushaltsposition.Verwendungsart))
{
if (CurrentPosition.position == (int)Haushaltsposition.Vermögen.Immobilie)
{
source.Add("gar nicht");
source.Add("als Sicherheit");
source.Add("verkaufen");
}
else
{
source.Add("gar nicht");
source.Add("als Sicherheit");
source.Add("auflösen");
}
}
var segmControl = new SfSegmentedControl()
{
ItemsSource = source,
FontSize = 15,
SelectionIndicatorSettings = new SelectionIndicatorSettings() { Color = (Color)MarkupExtensions.GetResourceValue("AccentSecondaryColor") },
Color = (Color)MarkupExtensions.GetResourceValue("AccentPrimaryColor"),
SelectionTextColor = (Color)MarkupExtensions.GetResourceValue("PrimaryColor"),
DisabledTextColor = (Color)MarkupExtensions.GetResourceValue("SecondaryTextColor"),
FontColor = (Color)MarkupExtensions.GetResourceValue("SecondaryTextColor"),
VisibleSegmentsCount = 3,
Margin = new Thickness(15,0,15,0),
BackgroundColor = Color.White,
SelectedIndex = 2
};
segmControl.SetBinding(SfSegmentedControl.SelectedIndexProperty, myBinding);
```
This is the view on UWP:
This is my view on Android:
Thank you for your advice.