Takoooooo 4 years ago
parent
commit
063e5e7be3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/Avalonia.Styling/LogicalTree/ControlLocator.cs

+ 4 - 1
src/Avalonia.Styling/LogicalTree/ControlLocator.cs

@@ -57,7 +57,10 @@ namespace Avalonia.LogicalTree
             private void Detached(object sender, LogicalTreeAttachmentEventArgs e)
             {
                 _value = null;
-              //  PublishNext(null);
+                if (_relativeTo.IsAttachedToLogicalTree)
+                {
+                    PublishNext(null);
+                }
             }
 
             private void Update()