зеркало из https://github.com/DeGsoft/maui-linux.git
[Android] add Element and Element Property Changed hooks for ImageButton (#4495)
This commit is contained in:
Родитель
7081d5eb04
Коммит
07c9ac74c5
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче