Browse Source

Add support for arbitrary data in views

Closes #932
Patrik Svensson 4 years ago
parent
commit
00456a4ee7
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Terminal.Gui/Core/View.cs

+ 6 - 0
Terminal.Gui/Core/View.cs

@@ -170,6 +170,12 @@ namespace Terminal.Gui {
 		/// </summary>
 		public Rune HotKeySpecifier { get => textFormatter.HotKeySpecifier; set => textFormatter.HotKeySpecifier = value; }
 
+		/// <summary>
+		/// Gets or sets arbitrary data for the view.
+		/// </summary>
+		/// <remarks>This property is not used internally.</remarks>
+		public object Data { get; set; }
+
 		internal Direction FocusDirection {
 			get => SuperView?.FocusDirection ?? focusDirection;
 			set {