Browse Source

Use correct control root

Nikita Tsukanov 8 years ago
parent
commit
b84e9e1123
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs

+ 3 - 4
src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs

@@ -35,15 +35,14 @@ namespace Avalonia.Win32.Interop.Wpf
 
         public class CustomControlRoot : EmbeddableControlRoot
         {
-            public CustomControlRoot()
+            public CustomControlRoot(WpfTopLevelImpl impl) : base(impl)
             {
                 EnforceClientSize = false;
-                
             }
 
             public override void InvalidateMeasure()
             {
-                ((FrameworkElement)PlatformImpl)?.InvalidateMeasure();
+                ((FrameworkElement) PlatformImpl)?.InvalidateMeasure();
                 base.InvalidateMeasure();
             }
         }
@@ -57,7 +56,7 @@ namespace Avalonia.Win32.Interop.Wpf
             _mouse = new WpfMouseDevice(this);
             _keyboard = AvaloniaLocator.Current.GetService<IKeyboardDevice>();
 
-            ControlRoot = new EmbeddableControlRoot(this);
+            ControlRoot = new CustomControlRoot(this);
             SnapsToDevicePixels = true;
             Focusable = true;
             DataContextChanged += delegate