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
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.