【发布时间】:2012-01-18 06:23:05
【问题描述】:
我正在使用此代码来创建对话框:
SettingsDialog settingDialog = new SettingsDialog ();
RootElement dialog = settingDialog.CreateDialog ();
DialogViewController dv = new DialogViewController (dialog, true);
dv.ViewDissapearing += delegate(object sender1, EventArgs e1) {
// update the values
Config.VendorId = settingDialog.VendorId;
} ;
NavigationController.PushViewController (dv, true);
这是 SettingsDialogClass 的代码
public class SettingsDialog
{
private EntryElement idElement;
public RootElement CreateDialog ()
{
idElement = new EntryElement ("Vendor Id", string.Empty, Config.VendorId.ToString (CultureInfo.InvariantCulture)){ KeyboardType = UIKeyboardType.NumberPad };
element = new RootElement ("Configuration"){
new Section (){
idElement
} ,
...
}
public string VendorId {
get {
return idElement.Value;
}
}
问题是上述属性总是返回旧值,它永远不会更新。 知道为什么吗?
谢谢, 伊格纳西奥
【问题讨论】:
标签: xamarin.ios monotouch.dialog