From dff0050252b6facee4d183750bbdfdf6de14b2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bator?= Date: Thu, 22 Nov 2018 17:41:16 +0100 Subject: [PATCH 1/2] Fixing view discovery for DryIoc for UWP Fixing a bug when a page could not inherit its destination viewmodel because VML assumed that if we naviagte to page, then the page has to have a frame. --- .../Windows10/Prism.DryIoc.Windows/DryIocContainerExtension.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Windows10/Prism.DryIoc.Windows/DryIocContainerExtension.cs b/Source/Windows10/Prism.DryIoc.Windows/DryIocContainerExtension.cs index ea41eaf18a..89fad2fc0a 100644 --- a/Source/Windows10/Prism.DryIoc.Windows/DryIocContainerExtension.cs +++ b/Source/Windows10/Prism.DryIoc.Windows/DryIocContainerExtension.cs @@ -51,7 +51,7 @@ public object Resolve(Type type, string name) public object ResolveViewModelForView(object view, Type viewModelType) { - if (view is Page page) + if (view is Page page && page.Frame != null) { var service = NavigationService.Instances[page.Frame]; return Instance.Resolve(viewModelType, new[] { service }); From eba378f2356db80de134e78cf2bb91222865b21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bator?= Date: Thu, 22 Nov 2018 17:41:57 +0100 Subject: [PATCH 2/2] Fixing view discovery for Unity for UWP Fixing a bug when a page could not inherit its destination viewmodel because VML assumed that if we naviagte to page, then the page has to have a frame. --- Source/Windows10/Prism.Unity.Windows/UnityContainerExtension.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Windows10/Prism.Unity.Windows/UnityContainerExtension.cs b/Source/Windows10/Prism.Unity.Windows/UnityContainerExtension.cs index 645ace573e..0ca375f256 100644 --- a/Source/Windows10/Prism.Unity.Windows/UnityContainerExtension.cs +++ b/Source/Windows10/Prism.Unity.Windows/UnityContainerExtension.cs @@ -49,7 +49,7 @@ public object Resolve(Type type, string name) public object ResolveViewModelForView(object view, Type viewModelType) { - if (view is Page page) + if (view is Page page && page.Frame != null) { var service = NavigationService.Instances[page.Frame]; ResolverOverride[] overrides = null;