Closed mjrichards91 closed 4 years ago
As an FYI, my workaround right now is this:
public class CustomSegmentedControlRenderer : SegmentedControlRenderer
{
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == "Renderer" && this.Control != null)
{
this.ConfigureIsEnabledForSegments();
}
}
private void ConfigureIsEnabledForSegments()
{
for (int i = 0; i < this.Control.ChildCount; i++)
{
var nativeButton = (RadioButton)this.Control.GetChildAt(i);
var segmentedControlOption = this.Element.Children[i];
nativeButton.Enabled = segmentedControlOption.IsEnabled;
}
}
}
Thank you.
I can confirm that iOS works and that UWP has the same issue as Android.
Will try and fix this.
I found the bug. It works now and will be fixed in the next version.
The color of the Disabled segment does not change on iOS, UWP or Android but if you try to choose the segment, you can't when IsEnabled=False.
I am using the SegmentedControl and SegmentedControlOption controls via XAML. At the most basic level, setting IsEnabled to False on an option does not disable it on Android (it works for iOS, unsure about UWP).
In this example, I am able to select both Option A and Option B.
I simplified this example to showcase that it does not work. My real world application sets the IsEnabled property through binding, so I am not sure if both issues are one in the same.