1using System.ComponentModel;
13 [TypeConverter(typeof(ReferenceTypeConverter))]
19 if (View is Controls.ImageButton ImageButton)
20 ImageButton.Clicked += this.Button_Clicked;
21 else if (View is Button Button)
22 Button.Clicked += this.Button_Clicked;
24 base.OnAttachedTo(View);
30 if (View is Controls.ImageButton ImageButton)
31 ImageButton.Clicked -= this.Button_Clicked;
32 else if (View is Button Button)
33 Button.Clicked -= this.Button_Clicked;
35 base.OnDetachingFrom(View);
38 private void Button_Clicked(
object? Sender, EventArgs e)
49 if (Element is not
null && Element.IsVisible)
53 if (Element is Entry Entry && Entry.Text is not
null)
54 Entry.CursorPosition = Entry.Text.Length;
Used for moving focus to the next UI component when a button has been clicked.
View? SetFocusTo
The view to move focus to.
static void FocusOn(View Element)
Sets focus on an element.
override void OnDetachingFrom(View View)
override void OnAttachedTo(View View)