FocusEventArgs.cs 1.0 KB

1234567891011121314151617181920212223
  1. namespace Terminal.Gui;
  2. /// <summary>Defines the event arguments for <see cref="View.HasFocus"/></summary>
  3. public class HasFocusEventArgs : CancelEventArgs<bool>
  4. {
  5. /// <summary>Initializes a new instance.</summary>
  6. /// <param name="currentHasFocus">The current value of <see cref="View.HasFocus"/>.</param>
  7. /// <param name="newHasFocus">The value <see cref="View.HasFocus"/> will have if the event is not cancelled.</param>
  8. /// <param name="currentFocused">The view that is losing focus.</param>
  9. /// <param name="newFocused">The view that is gaining focus.</param>
  10. public HasFocusEventArgs (bool currentHasFocus, bool newHasFocus, View currentFocused, View newFocused) : base (ref currentHasFocus, ref newHasFocus)
  11. {
  12. CurrentFocused = currentFocused;
  13. NewFocused = newFocused;
  14. }
  15. /// <summary>Gets or sets the view that is losing focus.</summary>
  16. public View CurrentFocused { get; set; }
  17. /// <summary>Gets or sets the view that is gaining focus.</summary>
  18. public View NewFocused { get; set; }
  19. }