What exactly are the differences between AdornerLayer.Update() and AdornerLayer.Update(UIElement)?
As far as I understand it, there is exactly one adorner layer per ui element, which you can get with AdornerLayer.GetAdornerLayer(Visual). The only difference I can see is if there isn't a adorner layer for each ui element. So for example if I have the following visual tree:
UIElement1
-> UIElement2
-> UIElement3
Then somehow UIElement2 and 3 don't have their own adorner layer but use the adorner layer of UIElement1. And then Update() would update all adorners for UIElement1, 2 and 3 and Update(UIElement) would only update the adorners for the corresponding ui element.
So what are the conditions for when a UI element has its own adorner layer and when it uses the adorner layer of a UI element higher up in the visual tree?
Each
UIElementdoes not automatically have its own, uniqueAdornerLayer. Take a look at this documentation:Adorners Overview - Adorning a Single UIElement
AdornerDecorator
So, if you use a
Windowas the root element, there is guaranteed to be at least oneAdornerin the visual tree, there may be more depending on what other elements you use.