You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
because my app is used in the field press twice back to exit is not an option.
Based on this [https://stackoverflow.com/a/52366043], I added these piece of code to ExtendedEntry and ExtendedEntryRenderer.
In ExtendedEntry public static readonly BindableProperty BackPressProperty=BindableProperty.Create("BackPress", typeof(EventHandler), typeof(ExtendedEntry), null); public event EventHandler BackPress; public bool OnBack() { EventHandler eventHandler = this.BackPress; eventHandler?.Invoke((object)this, EventArgs.Empty); return eventHandler != null; }
In ExtendedEntryRenderer public override bool DispatchKeyEventPreIme(KeyEvent e) { if(!_softKeboardService.IsKeyboardVisible() && e.KeyCode == Keycode.Back) { if(Element != null && Element is ExtendedEntry) { if (((ExtendedEntry)Element).OnBack()); return true; } } return base.DispatchKeyEventPreIme(e); }
Then in the event handler you can put a Navigation action or a message.
If you consider this addition useful you can add it.
Regards,
Pedro.
The text was updated successfully, but these errors were encountered:
Hi,
because my app is used in the field press twice back to exit is not an option.
Based on this [https://stackoverflow.com/a/52366043], I added these piece of code to ExtendedEntry and ExtendedEntryRenderer.
In ExtendedEntry
public static readonly BindableProperty BackPressProperty=BindableProperty.Create("BackPress", typeof(EventHandler), typeof(ExtendedEntry), null); public event EventHandler BackPress; public bool OnBack() { EventHandler eventHandler = this.BackPress; eventHandler?.Invoke((object)this, EventArgs.Empty); return eventHandler != null; }
In ExtendedEntryRenderer
public override bool DispatchKeyEventPreIme(KeyEvent e) { if(!_softKeboardService.IsKeyboardVisible() && e.KeyCode == Keycode.Back) { if(Element != null && Element is ExtendedEntry) { if (((ExtendedEntry)Element).OnBack()); return true; } } return base.DispatchKeyEventPreIme(e); }
Then in the event handler you can put a Navigation action or a message.
If you consider this addition useful you can add it.
Regards,
Pedro.
The text was updated successfully, but these errors were encountered: