我的WPF应用程序在其主窗口中有这个问题:
public partial class MainWindow : Window, ICallbackNotify
这个“ ICallbackNotify ”是为了与MapInfo COM通信 并确保UI 和 MapInfo之间的交互性
public interface ICallbackNotify : ISynchronizeInvoke
{
// Method called by MapInfoCallback class when user chooses custom OLE menuitem
void OnMenuItemClick(uint id);
// Method called by MapInfoCallback class when the status bar text changes
void OnStatusBarTextChanged(string text);
// Method called by MapInfoCallback class when window changes
void OnWindowContentsChanged(uint windowId);
}
问题是,这段代码在Windows From中工作得很好,但是当我把它放到WPF中时,有一个错误消息:
Error 1 'WpfApplication3.MainWindow' does not implement interface member 'System.ComponentModel.ISynchronizeInvoke.InvokeRequired' c:\users\dragon\documents\visual studio 2010\Projects\WpfApplication3\WpfApplication3\MainWindow.xaml.cs 25 26 WpfApplication3
我不知道为什么或如何解决这个问题