SharpSVN SvnUI.Bind to WPF window

安稳与你 提交于 2019-12-25 01:45:22

问题


I am guessing there is no way to Bind call SharpSVN in a WPF application? I was just following there tutorial, and I found out that you can't bind becuase this isn't a Windows.Forms application. Quite the bummer. I was really cooking there for a minute.


回答1:


Currently the answer is: No.

For compatibility SharpSvn is compiled against .Net 2.0, so doesn't have access to the WPF classes.

You could implement your own IWin32Window to provide a Hwnd.

Googling a bit provided me this sample code.

public class Window1 : Window, IWin32Window
{
   public IntPtr Handle
   {
      get
      {
         var interopHelper = new WindowInteropHelper(this);
         return interopHelper.Handle;
      }
   }
}


来源:https://stackoverflow.com/questions/8760846/sharpsvn-svnui-bind-to-wpf-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!