The current Button.Image property is mainly for displaying a small icon next to the text.
To avoid breaking changes, we should create a new ImageButton control. Both Button and ImageButton should derive from a common ButtonBase.
see Button API, but skip the Label
Implementation on Android, iOS, UWP in renderers.
I feel like this might be better as a new control instead of using Button.Image. That will prevent us from breaking old layouts. Plus, we probably want to use the native ImageButton controls, so we'll have a lot of code switches if we just reuse the same control.
@StephaneDelcroix @samhouts
I'm thinking for this we'll want to implement different images for different states Focused, Pressed, Normal, Disabled. It feels like the states aspect of image buttons are what differentiate it from just a Button with an Image.
The Image Button in the xamarin forms labs kind of captures what I'm thinking
https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/src/Forms/XLabs.Forms/Controls/ImageButton.cs
Android is really the only platform that has a specific "ImageButton" which derives from ImageView opposed to TextView and who's main differentiating features are a lack of a "setText" method and the idea of PushStates
iOS sets the image of a button via UIControlState
And with UWP we'd have to use VisualStates
But I feel like with this one we'll want to add a state structure or just properties that lets you depict the image to use for Focused, Pressed, Normal, Disabled
Or I know there's a VisualStateManager coming to Forms. Would it be better to just leverage that once it's prime time? @hartez
Most helpful comment
I feel like this might be better as a new control instead of using Button.Image. That will prevent us from breaking old layouts. Plus, we probably want to use the native ImageButton controls, so we'll have a lot of code switches if we just reuse the same control.