using System; using SampleApp.DependencyServices; using Xamarin.Forms; using SampleApp.iOS; using Xamarin.Forms.Platform.iOS; using SampleApp.Views; [assembly: ExportRenderer(typeof(IFocusEvents), typeof(iOSFocusEvents))] namespace SampleApp.iOS { public class iOSFocusEvents : ImageRenderer { protected override void OnElementChanged(ElementChangedEventArgs e) { base.OnElementChanged(e); if (Control != null) { SetNativeControl(new CustomButton()); } } } public class CustomButton : FormsUIImageView { public CustomButton() : base() { Console.WriteLine("Custom button created"); } public override void AccessibilityElementDidBecomeFocused() { base.AccessibilityElementDidBecomeFocused(); Functionality4.myLabel.Text = "Bell Image Has Focus"; } public override void AccessibilityElementDidLoseFocus() { base.AccessibilityElementDidLoseFocus(); Functionality4.myLabel.Text = "Bell Image does not have focus"; } } }