Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can programatically test the Visiblity and the <code>HitTestVisible</code> property of an element, however beyond this <strong>you can't actually test</strong> if a click event will be forwarded to the element or swallowed by elements on top of it - because blocking or forwarding clicks can happen in event handler methods which you simply can't determine in a generic way.</p> <p>Take the following example:</p> <ul> <li>You want to test if the <code>ParentElement</code> panel is clickable that has a <code>ChildElement</code> on it</li> <li><code>ChildElement</code> has an event handler attached to it that handles the click event, it's visible and its <code>HitTestVisible</code> property is set to true. </li> <li>Based on this you can't yet decide if the event will be forwarded to <code>ParentElement</code>: in the click event handler of <code>ChildElement</code> it can set the event's <code>Handled</code> property to true that would stop the ParentPanel receiving the event or it could leave it at false, making the ParentPanel receive the event.</li> </ul> <p>Thus if there are custom EventHandlers involved, you won't be able to tell for certain whether an element is clickable or not. The most you can do is check the <code>Visiblity</code> and <code>IsHitTestVisible</code> properties on child and parent elements and check where the children / parents are rendered relative to each other using the <a href="http://forums.silverlight.net/forums/p/38825/111580.aspx" rel="nofollow"><code>TransformToVisual</code></a> method.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload