Tab.cs 790 B

123456789101112131415161718192021222324252627282930313233
  1. namespace Terminal.Gui.Views;
  2. /// <summary>A single tab in a <see cref="TabView"/>.</summary>
  3. public class Tab : View
  4. {
  5. private string? _displayText;
  6. /// <summary>Creates a new unnamed tab with no controls inside.</summary>
  7. public Tab ()
  8. {
  9. BorderStyle = LineStyle.Rounded;
  10. CanFocus = true;
  11. TabStop = TabBehavior.NoStop;
  12. }
  13. /// <summary>The text to display in a <see cref="TabView"/>.</summary>
  14. /// <value></value>
  15. public string DisplayText
  16. {
  17. get => _displayText ?? "Unnamed";
  18. set
  19. {
  20. _displayText = value;
  21. SetNeedsLayout ();
  22. }
  23. }
  24. /// <summary>The control to display when the tab is selected.</summary>
  25. /// <value></value>
  26. public View? View { get; set; }
  27. }