我是 monotouch.dialog 的初学者。我正在尝试使用带有标题和值的覆盖radioelement从radiogroup中获取一个值作为经典下拉列表!
但问题是检测事件 OnSelect
多元素代码
public class MyRadioElement : RadioElement
{
private string Caption{get; set;}
private int ID{get; set;}
public MyRadioElement(string caption, int id, NSAction selected): base(caption, id)
{
Caption = caption;
ID = id;
OnSelected += selected;
}
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
base.Selected (dvc, tableView, path);
var selected = OnSelected;
if (selected != null)
selected ();
}
public event NSAction OnSelected;
}
根代码
var rootSex = new RootElement ("SEX",
sexUser = new RadioGroup ("", -1)){new Section ("INSERT SEX"){
from n in Def.Get_Sexes()
select (Element) new MyRadioElement (n.Descr, n.ID, ????delegate????? )}
};
我会使用委托来调用选择事件,但它给了我一个转换错误......
为什么???谢谢