Don't notify a non-inheritance child that the data context has begun changing, because it won't receive the accompanying end change notification.
Fixes#1245.
When a data context changes, it should be notified to all descendant controls who inherit the data context. This allows the `SelectingItemsControl` to defer setting the selected item until the `DataContext` has changed for the whole tree.
Renamed `OnDataContextChanging`/`OnDataContextChanged` to `OnDataContextBeginUpdate`/`OnDataContextEndUpdate` because `DataContextChanged` is now called from the property changed notification.
Fixes#507.
Shapes with Strech set to Fill would fail to size themselves correctly
when an infinite available size was passed to messure. This occurs
because the transform is calculated before a final size is known.
A flag was added that signals ArrangeOverride to calculate the
transform for the RenderedGeometry
Otherwise if `TextBox.CaretIndex` is set before the `TextBox`'s template is applied then it will be coerced to null on the `TextPresenter` when created as `Text` will still be null at this point.
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`.
Previously, if the user overrode `OnAttachedToLogicalTree` or `OnDetachedFromLogicalTree` 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 `OnAttachedToLogicalTreeCore`/`OnDetachedFromLogicalTreeCore`.
When a captured control is removed from the visual tree, clear the mouse capture.
Note that our capture logic needs to be improved - it shouldn't be possible to capture a non-visible or non-enabled control. This doesn't address that but it does fix the crash in #1203.
Fixes#1203