Tab.cs 805 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// A single tab in a <see cref="TabView"/>
  4. /// </summary>
  5. public class Tab {
  6. private string text;
  7. /// <summary>
  8. /// The text to display in a <see cref="TabView"/>
  9. /// </summary>
  10. /// <value></value>
  11. public string Text { get => text ?? "Unamed"; set => text = value; }
  12. /// <summary>
  13. /// The control to display when the tab is selected
  14. /// </summary>
  15. /// <value></value>
  16. public View View { get; set; }
  17. /// <summary>
  18. /// Creates a new unamed tab with no controls inside
  19. /// </summary>
  20. public Tab ()
  21. {
  22. }
  23. /// <summary>
  24. /// Creates a new tab with the given text hosting a view
  25. /// </summary>
  26. /// <param name="text"></param>
  27. /// <param name="view"></param>
  28. public Tab (string text, View view)
  29. {
  30. this.Text = text;
  31. this.View = view;
  32. }
  33. }