我做了一个自定义控件,但是界面既不加载也不报错
金蝶云社区-xxxxxxxxxxx
xxxxxxxxxxx
0人赞赏了该文章 2,788次浏览 未经作者许可,禁止转载编辑于2015年06月29日 15:10:24

如题,我做了一个自定义控件,但是界面既不加载也不报错,我参照着http://club.kisdee.com/home.php? ... 7&do=blog&id=118403做的。具体代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using EXSoftPhone;
using Kingdee.BOS.Client.Core;
namespace Kingdee.XPF.CustomControlPlugins
{
///


/// MainWindow.xaml 的交互逻辑
///

public class SmartCardReader : ContentControl, IKDCustomControl
{
public IKDCustomControlProxy Proxy { get; set; }
protected void FireOnCustomEvent(CustomEventArgs e)
{
if (this.Proxy != null)
{
this.Proxy.FireCustomEvent(e);
}
}
///
/// 界面组件初始化,如果没有界面要求,这里保留为空即可。
///

public void InitComponent()
{
////创建host对象
WindowsFormsHost host = new WindowsFormsHost();
////创建active 控件对象
AxEXSoftPhone.AxSoftphone Softphone1 = new AxEXSoftPhone.AxSoftphone();
////创建grid对象
Grid grid1 = new Grid();
host.Child = Softphone1;
grid1.Children.Add(host);
this.Content = new Border()
{
BorderThickness = new Thickness(1),
BorderBrush = new SolidColorBrush(Colors.Blue),
Child = grid1
};
}
///
/// 用于资源释放,在单据关闭时调用
///

public void Release()
{
this.Content = null;
}
}
}

请问这个要怎么改?