Skip to content

VisualTreeHelper.HitTest alternative in WinUI #7883

Answered by castorix
gautambjain asked this question in Q&A
Discussion options

You must be logged in to vote

Like in your other question, VisualTreeHelper.FindElementsInHostCoordinates can be used

like :

  // ptElement is Point
  IEnumerable<UIElement> elementStack = VisualTreeHelper.FindElementsInHostCoordinates(ptElement, (UIElement)sender);
  foreach (UIElement item in elementStack)
  {
     // Code...
  }

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gautambjain
Comment options

@castorix
Comment options

@gautambjain
Comment options

Answer selected by gautambjain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants