public static void InitializeFrom(this UIView nativeControl, SegmentControl formsControl) { if (nativeControl == null || formsControl == null) { return; } nativeControl.Layer.MasksToBounds = true; nativeControl.Layer.CornerRadius = (float)formsControl.CornerRadius; nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness); }
public static void UpdateFrom(this UIView nativeControl, SegmentControl formsControl, string propertyChanged) { if (nativeControl == null || formsControl == null) { return; } if (propertyChanged == SegmentControl.CornerRadiusProperty.PropertyName) { nativeControl.Layer.CornerRadius = (float)formsControl.CornerRadius; } if (propertyChanged == SegmentControl.BorderColorProperty.PropertyName) { nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness); } if (propertyChanged == SegmentControl.BorderThicknessProperty.PropertyName) { nativeControl.UpdateBorder(formsControl.BorderColor, formsControl.BorderThickness); } }