문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top