When we use any attached property against any dependency object, I use it, actually matching the property and value with the dependency object.
eg. <DockPanel><TextBlock x:Name="MyText" DockPanel.Dock="Top"/></DockPanel>
Here the value of "Top" is mapped to the DockPanels of the DockProperty through the text block "MyText" of the dependency object
But my question is when is this mapping located? The reason I'm asking is DockPanel DockProperty is static \ shared. Thus, it must have multiple Pair (Of value, dependency object) mappings that were associated with it in some internal dictionary. (just a hunch)
So it should be garbage collection when the dependency object is destroyed.
So, now my point is, is there any way I should know IF such depiction with attached property occurs (for example, some dispairing or dispose event for this attached property and dependency object)?
Also, if such garbage collection does not take place, is it not a memory leak?
Thanks Vinet Sanke.
source share