2
0

FocusEventArgs.cs 889 B

12345678910111213141516171819202122232425
  1. namespace Terminal.Gui;
  2. /// <summary>Defines the event arguments for <see cref="View.HasFocus"/></summary>
  3. public class FocusEventArgs : EventArgs
  4. {
  5. /// <summary>Initializes a new instance.</summary>
  6. /// <param name="leaving">The view that is losing focus.</param>
  7. /// <param name="entering">The view that is gaining focus.</param>
  8. public FocusEventArgs (View leaving, View entering) {
  9. Leaving = leaving;
  10. Entering = entering;
  11. }
  12. /// <summary>
  13. /// Gets or sets whether the event should be canceled. Set to <see langword="true"/> to prevent the focus change.
  14. /// </summary>
  15. public bool Cancel { get; set; }
  16. /// <summary>Gets or sets the view that is losing focus.</summary>
  17. public View Leaving { get; set; }
  18. /// <summary>Gets or sets the view that is gaining focus.</summary>
  19. public View Entering { get; set; }
  20. }