...during ApplyTemplate. This was so that ItemsControls could their find
ItemsPresenters nested in other templated controls. Instead use
IItemsPresenterHost to make the presenter register itself with its
TemplatedParent.
Usually controls are only registered with their name scope when they get
added to a rooted visual tree, but this causes problems for tests, and
would mean the templated control wouldn't work if the client called
ApplyTemplate themselves before the control is added to the visual tree.
Work around this by explicitly registering template controls with the
name scope when the template is applied.
To allow this, we need to allow controls to be registered with a name
scope multiple times.
Some tests still failing as controls are only registered with name scope
when attached to a rooted visual tree. Need to work around this by
explicitly registering controls when applying template.
Currently works so far as to scroll an image in the Images tab of the
test app. Hiding the scrollbars is currently disabled as it requires a
layout pass to be triggered during a layout pass. Need to work out a
way around that...