If we have e.g. a named UserControl in a window then we want that
control to be findable by name from the Window, so register with both
name scopes. This differs from WPF's behavior in that XAML manually
registers controls with name scopes based on the XAML file in which the
name attribute appears, but we're trying to avoid XAML magic in Avalonia
in order to made code-created UIs easy. This will cause problems if a
UserControl declares a name in its XAML and that control is included
multiple times in a parent control
(as the name will be duplicated), however at the moment I'm fine with
saying "don't do that".
Fixes#829.
There are still a few bugs around scrollbar behavior, and maybe Grid. To
see them, add a long item in the middle of VirtualizationTest's items,
resize the window to require a scrollbar and scroll up and down.
In Release build in main Avalonia assemblies (couldn't do it in
Avalonia.Markup.Xaml due to warnings in OmniXaml). To do this, fixed a
number of warnings.
Rather than repainting whenever, this adds a render loop which is called
N times per second. IRenderQueueManager and ITopLevelRenderer have been
removed, replaced by IRenderer.
Instead of `ContentPresenter`. This fixes a memory leak whereby
`DropDown` wasn't correctly parenting the `Rectangle` created for
`SelectionBoxItem` when the selected item is a control. Fixes#706.
After items are added or removed then the virtualizing panel must be
remeasured. It's usually not remeasured if the available size is the
same as on the last measure as that causes an infinite loop; this adds a
`ForceInvalidateMeasure` to `IVirtualizingPanel` which will force a
remeasure even if the available size hasn't changed. Also adds tests for
the behavior.
If a TextBox is e.g. bound to an int and the user types "02" then the
TextBox text should be "02" - not the value that comes back from the
binding which will be "2".
@donandren correctly identified a problem with the `ItemsPresenter` but
he put the tests in the `ListBox` tests. Moved them to the correct
place. Also tweak formatting in `ItemContainerGenerator.InsertSpace`.