Browse Source

Perspex.Win32 shouldn't reference types from WPF, that causes issues with Mono build

pull/104/head
Nikita Tsukanov 11 years ago
parent
commit
4f1c80d50d
  1. 33
      src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs
  2. 3
      src/Windows/Perspex.Win32/Perspex.Win32.csproj

33
src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs

@ -1,47 +1,14 @@
namespace Perspex.Win32
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Interop;
using Perspex.Win32.Interop;
public class EmbeddedWindowImpl : WindowImpl
{
private static readonly System.Windows.Forms.UserControl WinFormsControl = new System.Windows.Forms.UserControl();
public HwndHost Host { get; set; }
private class FakeHost : HwndHost
{
private readonly IntPtr hWnd;
public FakeHost(IntPtr hWnd)
{
this.hWnd = hWnd;
}
protected override HandleRef BuildWindowCore(HandleRef hwndParent)
{
UnmanagedMethods.SetParent(this.hWnd, hwndParent.Handle);
return new HandleRef(this, this.hWnd);
}
protected override void DestroyWindowCore(HandleRef hwnd)
{
}
}
public IntPtr Handle { get; private set; }
public HwndHost CreateWpfHost()
{
return new FakeHost(this.Handle);
}
protected override IntPtr CreateWindowOverride(ushort atom)
{
var hWnd = UnmanagedMethods.CreateWindowEx(

3
src/Windows/Perspex.Win32/Perspex.Win32.csproj

@ -34,8 +34,6 @@
<DocumentationFile>bin\Release\Perspex.Win32.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
<Private>True</Private>
@ -62,7 +60,6 @@
<Reference Include="System.Reactive.PlatformServices">
<HintPath>..\..\..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs">

Loading…
Cancel
Save