- Make `VisualExtensions.TranslatePoint` respect render transforms.
- Move `IVisual.TransformToVisual` out of the interface and into `VisualExtensions` as an extension method
- Make `TranslatePoint` return a nullable value as `TransformToVisual` does, so it can return null when controls don't have a common ancestor
Previously, if the user overrode `OnAttachedToVisualTree` or `OnDetachedFromVisualTree` and forgot to call the base implementation, the events wouldn't be raised. It's very important that these events get raised so moved the code to raise them to `OnAttachedToVisualTreeCore`/`OnDetachedFromVisualTreeCore`.
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.
If a child that already has a parent was added as a visual child of
another control and the exception caught, the control would still be
present in the VisualChildren collection.
When setting the visual parent of a control, make sure that it's not
already set. The code in issue #513 was trying to reparent an already
parented control, causing problems - this makes sure that this can't
happen.
Also made a few other changes along the way:
- Add MaxClientSize to ILayoutRoot
- Store IRenderRoot in Visual and use that to calculate
IsAttachedToVisualTree
- Make Affects* methods take multiple properties
This is needed so that things like the following can be done:
<TreeView>
<TreeView.Styles>
<Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded}"/>
</Style>
</TreeView.Styles>
<TreeView>
(At the moment we have TreeDataTemplate.IsExpanded but this isn't good
enough: it only supports setting IsExpanded on creation of the item with
no binding.)
With this commit, setters can now contain bindings, but they aren't yet
applied correctly. As part of this commit, classes related to binding
have been moved to the Perspex.Data namespace.