Is there an event triggered by UIElement position change? RRS feed

  • Question

  • How can an app get the notification of the change of a UIElement's position caused by any reason?


    Sunday, April 13, 2014 2:41 PM

All replies

  • What do you mean by position? If you mean the actual location it appears on the screen then there isn't a direct notification. That position is the combination of several different effects.

    UIElements don't have position on their own. Layout is handled by their containers, and where the element renders can be modified by rendering transforms.


    Sunday, April 13, 2014 5:06 PM
  • Thanks, Rob, for the clarification.  Yes, that is what I meant - the location on the screen.

    Let me tell you what I am trying to achieve.  You perhaps can provide a tip.  I want to know when an item of a ListView is visible (i.e. shows up on the screen) and when it becomes invisible (e.g. due to scrolling).  I figured that I could use  TransformToVisual to find its location hence determine whether it is visible.  I do not want to have a loop polling the location, but want to get notified when its location changes.

    Maybe there is a far better way to do this. 


    Sunday, April 13, 2014 5:21 PM