You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 800247f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(dependencyobject): Make shared value links to owners non-owning
A shareable DependencyObject used as a property value (brush, transform,
projection, backdrop, ...) records the element it is applied to as its
single associated parent with a strong reference, and the DataContext
that element pushes into it stays applied after the value is replaced on
the element. A long-lived shared value (style setter value, static brush)
therefore retained the last element it was applied to and that element's
DataContext, keeping whole pages alive after navigation.
Hold the associated parent weakly, matching WinUI where the
CMultiParentShareableDependencyObject parent association is non-owning,
and clear the inherited DataContext when the only parent unassociates
(WinUI: no mentor, bindings re-resolve against nothing). A collected
parent still counts as a first parent, so the next consumer disables
inheritance and drops the DataContext exactly as when the first parent is
alive; the collectible-ALC sweep frees an expired slot the same way.
Transform.Changed and Projection.Changed subscribers (the render
transform adapter, Popup's arrange forwarding, UIElement's projection
handler) now register weakly, so a transform or projection shared through
a Style setter no longer roots every element ever styled with it.
ToolTipService kept m_CurrentToolTip assigned after the automatic tooltip
closed, rooting the tooltip and its owner until another tooltip opened;
clear it when the service closes the current tooltip, as WinUI does in
ToolTip::OnIsOpenChanged.
Fixesunoplatform#25099
// First consumption records the element as the brush's InheritanceContext parent.
103
-
element.Background=brush;
86
+
Application.CleanupAllSecondaryAlcCaches();
104
87
105
-
returnnewWeakReference(element);
88
+
varconsumer=newBorder();
89
+
consumer.Background=brush;
90
+
Assert.AreSame(consumer,AssociatedParentOf(brush),"ALC teardown cleanup must free the slot of an already-collected parent so the resource re-associates with its next live consumer.");
0 commit comments