Monotouch.Dialog:BooleanElement的ValueChanged事件未触发

时间:2012-03-02 10:08:34

标签: c# xamarin.ios monotouch.dialog

获取BooleanElement's ValueChanged事件发生需要特殊技巧吗? 如果我切换状态,则永远不会执行以下代码:

this.oElementSenderCC = new BooleanElement ("Send Copy To Myself" ), true);
this.oElementSenderCC.ValueChanged += (sender, e) => this.SelectedSenderCC = this.oElementSenderCC.Value;

1 个答案:

答案 0 :(得分:2)

这似乎对我有用

BooleanElement boolElm = new BooleanElement("Bool",false);
boolElm.ValueChanged+=delegate
{ Console.WriteLine(boolElm.Value); };