Question

Is there a way to know is certain FrameworkElement was rendered to the screen. For example. I have two rectangles, and one overlap other. But I'm not sure about "how much" one overlap other.

So I need to know is user will see both rectangles, or will see only one, or will see one fully and one partially?

Was it helpful?

Solution

It all depends on what kind of parent container it is, if both rectangles are inside StackPanel then they will not, you have to either make a custom container or use canvas as parent of these rectangles.

Then you can get LocalToScreen or such similar methods to get their absolute positions compared to screen or top parent window and find out whether they overlap or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top