Browse Source

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 years ago
parent
commit
1f4d21244a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Windows/Avalonia.Win32/Win32Platform.cs

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

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