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
ItemsControlExtensions.GetClosest contains this code:
foreach (var i in items) {
var uiElement = i as UIElement;
if (uiElement != null) {
var p = uiElement.TransformToAncestor(itemsControl).Transform(new Point(0, 0));
However, in some situations, the item i might not be a child of the itemsControl (for example when nesting ListBoxes containing draggable entries). In such a case, I got a InvalidOperationException from TransformToAncestor (with the German message "Das angegebene Visual-Objekt ist kein übergeordnetes Element dieses Visual-Objekts." which translates to: "The given Visual object is no ancestor of this Visual object.")
Therefore a fix should be implemented that makes sure that i is in fact a child of itemsControl.
The text was updated successfully, but these errors were encountered:
ItemsControlExtensions.GetClosest
contains this code:However, in some situations, the item
i
might not be a child of theitemsControl
(for example when nestingListBoxe
s containing draggable entries). In such a case, I got aInvalidOperationException
fromTransformToAncestor
(with the German message "Das angegebene Visual-Objekt ist kein übergeordnetes Element dieses Visual-Objekts." which translates to: "The given Visual object is no ancestor of this Visual object.")Therefore a fix should be implemented that makes sure that
i
is in fact a child ofitemsControl
.The text was updated successfully, but these errors were encountered: