From cce06228c7d640a426df6b2a004339620506950d Mon Sep 17 00:00:00 2001 From: Tommy Gombar Date: Fri, 13 Aug 2021 17:19:04 +0100 Subject: [PATCH 1/2] Task: DispatcherQueue property moved across name spaces. WinUI 3 API change. https://github.com/PrismLibrary/Prism/discussions/2523 --- src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs b/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs index 228f993daa..9d593cd283 100644 --- a/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs +++ b/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs @@ -32,7 +32,7 @@ public static bool CheckAccess(this DependencyObject instance) { // Dispatcher queue HasThreadAccess is not yet implemented in Uno, we can fall back on CoreDispatcher // See https://github.com/unoplatform/uno/issues/5818 - if(ApiInformation.IsPropertyPresent("Microsoft.System.DispatcherQueue", nameof(Microsoft.System.DispatcherQueue.HasThreadAccess))) + if(ApiInformation.IsPropertyPresent("Microsoft.UI.Dispatching.DispatcherQueue", nameof(Microsoft.UI.Dispatching.DispatcherQueue.HasThreadAccess))) { return instance.DispatcherQueue.HasThreadAccess; } From 6f106f45434599b59a9f0412d21e5e74864f1c3f Mon Sep 17 00:00:00 2001 From: Tommy Gombar Date: Wed, 25 Aug 2021 20:32:23 +0100 Subject: [PATCH 2/2] Task: Keep the old namespace for mobile and mac platforms. https://github.com/PrismLibrary/Prism/discussions/2523 --- .../Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs b/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs index 9d593cd283..52e217410b 100644 --- a/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs +++ b/src/Uno/Prism.Uno/Extensions/DependencyObjectExtensions.Uno.cs @@ -32,7 +32,11 @@ public static bool CheckAccess(this DependencyObject instance) { // Dispatcher queue HasThreadAccess is not yet implemented in Uno, we can fall back on CoreDispatcher // See https://github.com/unoplatform/uno/issues/5818 +#if __ANDROID__ || __IOS__ || __MACOS__ + if(ApiInformation.IsPropertyPresent("Microsoft.System.DispatcherQueue", nameof(Microsoft.System.DispatcherQueue.HasThreadAccess))) +#else if(ApiInformation.IsPropertyPresent("Microsoft.UI.Dispatching.DispatcherQueue", nameof(Microsoft.UI.Dispatching.DispatcherQueue.HasThreadAccess))) +#endif { return instance.DispatcherQueue.HasThreadAccess; }