From 6dc2903694bc9fe6a9c5b95fb5e73fc72a0b6894 Mon Sep 17 00:00:00 2001 From: Kev Hannen Date: Thu, 29 Jun 2023 12:17:25 +0100 Subject: [PATCH 1/2] Fix ImageButton CornerRadius type #37 --- src/Fabulous.XamarinForms/Views/Controls/ImageButton.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fabulous.XamarinForms/Views/Controls/ImageButton.fs b/src/Fabulous.XamarinForms/Views/Controls/ImageButton.fs index ccecaf3..a4e0aac 100644 --- a/src/Fabulous.XamarinForms/Views/Controls/ImageButton.fs +++ b/src/Fabulous.XamarinForms/Views/Controls/ImageButton.fs @@ -20,7 +20,7 @@ module ImageButton = let BorderWidth = Attributes.defineBindableFloat ImageButton.BorderWidthProperty - let CornerRadius = Attributes.defineBindableFloat ImageButton.CornerRadiusProperty + let CornerRadius = Attributes.defineBindableInt ImageButton.CornerRadiusProperty let IsLoading = Attributes.defineBindableBool ImageButton.IsLoadingProperty @@ -103,7 +103,7 @@ type ImageButtonModifiers = /// Set the corner radius of the image button /// The corner radius of the image button. [] - static member inline cornerRadius(this: WidgetBuilder<'msg, #IImageButton>, value: float) = + static member inline cornerRadius(this: WidgetBuilder<'msg, #IImageButton>, value: int) = this.AddScalar(ImageButton.CornerRadius.WithValue(value)) [] From baf7ec2dc50b0fb01dbdf8218eebf9e2eac102c3 Mon Sep 17 00:00:00 2001 From: Kev Hannen Date: Thu, 29 Jun 2023 16:01:11 +0100 Subject: [PATCH 2/2] Update docs to match type change --- docs/v2/apis/controls/image-button.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/v2/apis/controls/image-button.md b/docs/v2/apis/controls/image-button.md index 54eac2c..9c3ecea 100644 --- a/docs/v2/apis/controls/image-button.md +++ b/docs/v2/apis/controls/image-button.md @@ -30,18 +30,18 @@ For details on how the control actually works, please refer to the [Xamarin.Form ## Properties -| Properties | Description | -|--|--| -| borderColor(light: FabColor, ?dark: FabColor) | Sets the border color | -| borderWidth(value: float) | Sets the border width | -| cornerRadius(value: float) | Sets the corner radius | -| isLoading(value: bool) | Sets if the image is currently loading | -| isOpaque(value: bool) | Sets if the image is opaque | -| isPressed(value: bool) | Sets if the image is currently pressed | -| padding(value: Thickness) | Sets the padding | -| padding(value: float) | Sets a uniform padding | +| Properties | Description | +|---------------------------------------------------------------|--| +| borderColor(light: FabColor, ?dark: FabColor) | Sets the border color | +| borderWidth(value: float) | Sets the border width | +| cornerRadius(value: int) | Sets the corner radius | +| isLoading(value: bool) | Sets if the image is currently loading | +| isOpaque(value: bool) | Sets if the image is opaque | +| isPressed(value: bool) | Sets if the image is currently pressed | +| padding(value: Thickness) | Sets the padding | +| padding(value: float) | Sets a uniform padding | | padding(left: float, top: float, right: float, bottom: float) | Sets the padding | -| reference(value: ViewRef<ImageButton>) | Sets a `ViewRef` instance to retrieve the `Xamarin.Forms.ImageButton` instance associated to this widget | +| reference(value: ViewRef<ImageButton>) | Sets a `ViewRef` instance to retrieve the `Xamarin.Forms.ImageButton` instance associated to this widget | ## Events