Skip to content

Commit c245979

Browse files
Unregister the Loaded event in Relative Ancestor
Helps with #4175
1 parent afebbd3 commit c245979

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/FrameworkElement/FrameworkElementExtensions.RelativeAncestor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ private static void FrameworkElement_Loaded(object sender, RoutedEventArgs e)
8080
{
8181
if (sender is FrameworkElement fe)
8282
{
83+
fe.Loaded -= FrameworkElement_Loaded;
8384
SetAncestor(fe, fe.FindAscendant(GetAncestorType(fe)));
8485
}
8586
}
8687
}
87-
}
88+
}

0 commit comments

Comments
 (0)