我想使用单点触控对话框作为某些数值的不可编辑数据显示。但是调用 DialogViewController.ReloadData 不会更新绑定对象的数据。
class AccountFormModel
{
[Section("Account data", "")]
[Caption("Balance")]
public string balance;
}
...
private void InitComponents()
{
accountFormModel = new AccountFormModel();
accountFormModel.balance = "TestTestTest";
bc = new BindingContext(this, accountFormModel, "AccountData");
dialogViewController = new DialogViewController(bc.Root);
dialogViewController.Autorotate = true;
}
private void RefreshData()
{
string b = SomeDatasource.Account.Balance.ToString("N4");
accountFormModel.balance = "$" + b;
dialogViewController.ReloadData();
}
调试显示 refreshData 方法中的 accountFormModel.balance 设置为正确的值,但模拟器中的表单没有任何变化(保持 TestTestTest)。我做错了什么?