1
0
Эх сурвалжийг харах

register `DragSource` after the UI thread has set

due to the fact that the UI-Thread is unknown, there
is no OLEContext available and the platform specific
DragSource will never be used.
boombuler 7 жил өмнө
parent
commit
1f4d21244a

+ 3 - 3
src/Windows/Avalonia.Win32/Win32Platform.cs

@@ -86,11 +86,11 @@ namespace Avalonia.Win32
                 .Bind<IWindowingPlatform>().ToConstant(s_instance)
                 .Bind<IWindowingPlatform>().ToConstant(s_instance)
                 .Bind<IPlatformIconLoader>().ToConstant(s_instance);
                 .Bind<IPlatformIconLoader>().ToConstant(s_instance);
 
 
-            if (OleContext.Current != null)
-                AvaloniaLocator.CurrentMutable.Bind<IPlatformDragSource>().ToSingleton<DragSource>();
-
             UseDeferredRendering = deferredRendering;
             UseDeferredRendering = deferredRendering;
             _uiThread = UnmanagedMethods.GetCurrentThreadId();
             _uiThread = UnmanagedMethods.GetCurrentThreadId();
+
+            if (OleContext.Current != null)
+                AvaloniaLocator.CurrentMutable.Bind<IPlatformDragSource>().ToSingleton<DragSource>();
         }
         }
 
 
         public bool HasMessages()
         public bool HasMessages()