Browse Source

The current view is called once instead of being called for each SubView added.

BDisp 5 years ago
parent
commit
ecf9ba0c1c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Terminal.Gui/Core/View.cs

+ 2 - 2
Terminal.Gui/Core/View.cs

@@ -879,7 +879,7 @@ namespace Terminal.Gui {
 		/// <param name="view">The subview being added.</param>
 		/// <param name="view">The subview being added.</param>
 		public virtual void OnAdding (View view)
 		public virtual void OnAdding (View view)
 		{
 		{
-			Adding?.Invoke (view);
+			view.Adding?.Invoke (this);
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -888,7 +888,7 @@ namespace Terminal.Gui {
 		/// <param name="view">The subview being removed.</param>
 		/// <param name="view">The subview being removed.</param>
 		public virtual void OnRemoving (View view)
 		public virtual void OnRemoving (View view)
 		{
 		{
-			Removing?.Invoke (view);
+			view.Removing?.Invoke (this);
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>