diff --git a/build/ReactiveUI.props b/build/ReactiveUI.props
index f827cb9a32..d8e86e917e 100644
--- a/build/ReactiveUI.props
+++ b/build/ReactiveUI.props
@@ -1,5 +1,5 @@
-
+
diff --git a/src/Avalonia.ReactiveUI/AutoDataTemplateBindingHook.cs b/src/Avalonia.ReactiveUI/AutoDataTemplateBindingHook.cs
index 4881c77034..fe4e9dd94a 100644
--- a/src/Avalonia.ReactiveUI/AutoDataTemplateBindingHook.cs
+++ b/src/Avalonia.ReactiveUI/AutoDataTemplateBindingHook.cs
@@ -48,6 +48,10 @@ namespace Avalonia.ReactiveUI
if (itemsControl.ItemTemplate != null)
return true;
+ if (itemsControl.DataTemplates != null &&
+ itemsControl.DataTemplates.Count > 0)
+ return true;
+
itemsControl.ItemTemplate = DefaultItemTemplate;
return true;
}
diff --git a/src/Avalonia.ReactiveUI/RoutedViewHost.cs b/src/Avalonia.ReactiveUI/RoutedViewHost.cs
index 1af8012a20..421633cd58 100644
--- a/src/Avalonia.ReactiveUI/RoutedViewHost.cs
+++ b/src/Avalonia.ReactiveUI/RoutedViewHost.cs
@@ -65,8 +65,15 @@ namespace Avalonia.ReactiveUI
{
this.WhenActivated(disposables =>
{
- this.WhenAnyObservable(x => x.Router.CurrentViewModel)
- .DistinctUntilChanged()
+ var routerRemoved = this
+ .WhenAnyValue(x => x.Router)
+ .Where(router => router == null)
+ .Cast