In WPF Adorners are used to place interactive cues above elements in you interface, think grab handles for resizeing or overlays for error messages. MSDN has an overview of the WPF adorner system. Under the hood adorners track their adorned elements by listening to LayoutUpdated on their adorned element. The LayoutUpdated event fires for all elements in an element tree whenever *any* element in the tree performs layout, this makes LayoutUpdated event handlers a potential performance and scalability problem in large element trees and the adorner system is no exception.
Enter LocalAdorner. If you are willing to give up some of the flexibility of WPF adorners LocalAdorner becomes a more lightweight and scalable alternative. LocalAdorner acts like Decorator, you wrap it around the element you want adorned and set its Adornment property to the element you want to adorn with. Because LocalAdorner is the parent of the adorned element they both layout in the same location without needing LayoutUpdated to keep them synchronized.
The source and a sample application for the decorator can be found on codeplex under,
Projects\Libraries\LocalAdorners for the decorator.
Projects\Applications\LocalAdorner for a sample application.
This posting is provided "AS IS" with no warranties, and confers no rights.