Attached Property Changed Event?
Posted
by Michael Menne
on Stack Overflow
See other posts from Stack Overflow
or by Michael Menne
Published on 2010-03-17T13:08:53Z
Indexed on
2010/03/17
13:11 UTC
Read the original article
Hit count: 632
Hello,
ist there a way to get a change notification if an attached property changed?
A simple example is a Canvas
with a Rectangle
in it. The position of the Rectange
is set by using the DepenendyProperties Canvas.Top
and Canvas.Left
. I'm using an Adorner to move the Rectangle around by changing the Canvas.Top
and Canvas.Left
.
<Canvas Width="500" Height="500" >
<Rectangle Width="40" Height="40" Canvas.Left="10" Canvas.Top="20" />
</Canvas>
The next step is to create an Arrow between two Rectangles
. In order to keep track of the moving Rectangles
the Arrow must get a change notification whenever the position of a Rectangle
changes. This would be easy if I could just get a changed notification when the Attached Property Canvas.Top
changes.
Thanks for any help, Michael
© Stack Overflow or respective owner