【发布时间】:2014-04-05 14:58:11
【问题描述】:
我想创建自定义控件,该控件将能够使用 Script# 重用
public class HallView : Element
{
public int HallId;
public HallView(): base()
{
this.AddEventListener("click", Click, false);
}
private void Click(ElementEvent e)
{
Script.Alert("Click " + this.HallId);
}
}
然后像重用 HallView 一样
HallView hall = new HallView();
hall.ClassName = "hall clickableSection";
container.AppendChild(hall);
问题是我不能调用任何元素的方法,甚至可以编译和构建 对象没有方法 addEventListener
或
对象没有方法 appendChild
【问题讨论】:
标签: script#