[Android] add Element and Element Property Changed hooks for ImageButton (#4495)

This commit is contained in:
Shane Neuville 2018-11-22 02:31:05 -07:00 коммит произвёл Stephane Delcroix
Родитель 7081d5eb04
Коммит 07c9ac74c5
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -172,10 +172,15 @@ namespace Xamarin.Forms.Platform.Android
UpdateInputTransparent();
UpdatePadding();
ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(oldElement, ImageButton));
OnElementChanged(new ElementChangedEventArgs<ImageButton>(oldElement, ImageButton));
ImageButton?.SendViewInitialized(Control);
}
protected virtual void OnElementChanged(ElementChangedEventArgs<ImageButton> e)
{
ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(e.OldElement, e.NewElement));
}
public override void Draw(Canvas canvas)
{
if (ImageButton == null)
@ -258,8 +263,7 @@ namespace Xamarin.Forms.Platform.Android
_inputTransparent = ImageButton.InputTransparent;
}
// Image related
void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
UpdateInputTransparent();