FocusEventArgs.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. namespace Terminal.Gui;
  2. /// <summary>Defines the event arguments for <see cref="View.SetFocus()"/></summary>
  3. public class FocusEventArgs : EventArgs
  4. {
  5. /// <summary>Constructs.</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. /// Indicates if the current focus event has already been processed and the driver should stop notifying any other
  14. /// event subscriber. It's important to set this value to true specially when updating any View's layout from inside the
  15. /// subscriber method.
  16. /// </summary>
  17. public bool Handled { get; set; }
  18. /// <summary>Indicates the view that is losing focus.</summary>
  19. public View Leaving { get; set; }
  20. /// <summary>Indicates the view that is gaining focus.</summary>
  21. public View Entering { get; set; }
  22. }