Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

FrameworkElement overlay notification?

Closed Thread
 
Thread Tools Display Modes
Old 01-31-2006   #1 (permalink)
Jason Dolinger
Guest


 

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
Old 02-02-2006   #2 (permalink)
Nick Kramer [MSFT]
Guest


 

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



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animating parts of a custom FrameworkElement (OnRender and DoubleAnimation question) Illumineo Avalon 2 06-26-2006 02:22 PM
API Standards question: FrameworkElement.Focusable Keith Patrick Avalon 3 02-27-2006 02:11 AM
How to get the coordinates of a FrameworkElement? Jason Dolinger Avalon 2 01-31-2006 07:00 AM
Does FrameworkElement.RemoveLogicalChild(object child) work? Jason Dolinger Avalon 3 01-31-2006 06:59 AM
Re: Implementing z-order control of FrameworkElement children Nancy Phan [MS] Avalon 1 01-10-2006 03:52 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50