![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | FrameworkElement overlay notification? Hi all, Is there a way to receive an event notification when some other element in a visual tree overlays the current element? For example, I have a grid with a TextBlock in it. At runtime another textblock gets inserted into the visual tree directly overlaying the existing box (or at least a portion of it). Is there some event that we can hook into when part of the tree is covered up? I'm trying to figure this out for translucency type issues. I want to adjust the Opacity value of this box when it is covered up. Even better, is there some way to indicate that when a particular visual element is in the tree, to change the opacity of the entire area underneath that element? This will go quite a way towards helping to develop some nice translucent effects. Thanks all, Jason |
My System Specs![]() |
| | #2 (permalink) |
| | Re: FrameworkElement overlay notification? Not really information WPF tries to provide -- it's extremely expensive to calculate for every possible element. For your specific scenario, I can think of a couple approaches -- * After every change in layout, call InputHitTest with accordance of your control and see if you get the same control * or better, hook whatever logic put the control there in the first place. E.g., override some method on Grid. -- -Nick Kramer [MSFT] http://blogs.msdn.com/nickkramer --- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Jason Dolinger" <jdolinger@lab49.com> wrote in message news:euLXd1pJGHA.424@TK2MSFTNGP12.phx.gbl... > Hi all, > > Is there a way to receive an event notification when some other element in > a visual tree overlays the current element? For example, I have a grid > with a TextBlock in it. At runtime another textblock gets inserted into > the visual tree directly overlaying the existing box (or at least a > portion of it). Is there some event that we can hook into when part of > the tree is covered up? > > I'm trying to figure this out for translucency type issues. I want to > adjust the Opacity value of this box when it is covered up. Even better, > is there some way to indicate that when a particular visual element is in > the tree, to change the opacity of the entire area underneath that > element? This will go quite a way towards helping to develop some nice > translucent effects. > > Thanks all, > Jason |
My System Specs![]() |