Browse Source

Merge branch 'master' into issues/1930

Steven Kirk 7 years ago
parent
commit
ee37243176
1 changed files with 1 additions and 7 deletions
  1. 1 7
      src/Avalonia.Controls/Presenters/ContentPresenter.cs

+ 1 - 7
src/Avalonia.Controls/Presenters/ContentPresenter.cs

@@ -197,13 +197,6 @@ namespace Avalonia.Controls.Presenters
             }
         }
 
-        /// <inheritdoc/>
-        protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
-        {
-            base.OnAttachedToVisualTree(e);
-            _dataTemplate = null;
-        }
-
         /// <summary>
         /// Updates the <see cref="Child"/> control based on the control's <see cref="Content"/>.
         /// </summary>
@@ -268,6 +261,7 @@ namespace Avalonia.Controls.Presenters
         protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
         {
             base.OnAttachedToLogicalTree(e);
+            _dataTemplate = null;
             _createdChild = false;
             InvalidateMeasure();
         }