Split resource nodes into two types:
- `IResourceHost` represents controls and `Application`
- `IResourceProvider` represents resource dictionaries and styles, these are owned by `IResourceHost`s
Dynamic resources are now always resolved from an `IResourceHost`: if an `IResourceProvider` doesn't have a host then a dynamic resource in the resource provider will not be resolved. Resource providers no longer have a `ResourcesChanged` event, instead they notify their `IResourceHost` owner of a resource change by calling the `NotifyHostedResourcesChanged` method.
- Don't use Rx in the styling system. Instead introduces `IStyleActivator` which is like an `IObservable<bool>`-lite in order to cut down on allocations.
- #nullable enable on touched files
- When detaching set `Parent` to `null` before raising the `DetachedFromLogicalTree` event
- To do this, we need to store the logical root in the control so that e.g. a child control can be detached in a `DetachedFromLogicalTree` handler
- Add `Source` and `Parent` properties to `LogicalTreeAttachmentEventArgs` to give more context on what caused the attachment/detachment
This is a relic from when we were targeting a PCL profile that didn't have `System.ComponentModel.ISupportInitialize`. Now that we have that, use it instead.
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.
- Set `InheritanceParent` before Parent so that control doesn't
initially inherit the wrong DataContext
- Don't set `InheritanceParent` when setting `Parent` if
`InheritanceParent` already set
- Added `IDataTemplate.SupportsRecycling`
If a `ContentPresenter`s content is assigned a value which matches the
current `DataTemplate` then just change the
`ContentPresenter.DataContext` and the existing item will update itself.
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