private void ParentWindow_GotFocus(object?sender, Avalonia.Input.GotFocusEventArgs e) { if (window != null) { window.Topmost = true; window.Topmost = false; } IAvaloniaApplication.Instance.SetTopmostOneTime(); }
private static void OnGotFocus(object?sender, Avalonia.Input.GotFocusEventArgs e) { if (sender is not AutoCompleteBox acb) { return; } acb.DropDownOpening -= CancelDropDownOpening; }
private void DangerousControl_GotFocus(object?sender, Avalonia.Input.GotFocusEventArgs e) { if (showDangerousWarning) { Focus(); // Remove focus from dangerous control by setting focus to SaveSlotInfoView MainWindowViewModel.Instance.ShowPopup("Editing your Hunter Rank or XP can be very dangerous and is a untested feature.\nI am not going to stop you, but keep in mind that if you screw this up it's on you."); showDangerousWarning = false; } }
private void AuthenticationView_GotFocus(object sender, Avalonia.Input.GotFocusEventArgs e) { if (e?.Source is Button) { if (((Button)e.Source).Name == "btnIdentitySelector") { _txtPassword.Focus(); e.Handled = true; } if (((Button)e.Source).Name == "btnAdvancedFunctions") { _txtAltID.Focus(); e.Handled = true; } } }
private void Window_GotFocus(object?sender, Avalonia.Input.GotFocusEventArgs e) { ParentWindow?.Focus(); }