我不断收到以下错误消息:
MvxBind:Warning: 15.51 Unable to bind: source property source not found
Cirrious.MvvmCross.Binding.Parse.PropertyPath.PropertyTokens.MvxPropertyNamePropertyToken on null-object
找不到解决方案 - 从现在开始 3 小时。
这就是视图模型:
public class SettingsViewModel : MvxViewModel
{
public SettingsViewModel()
{
}
private bool testdata;
public bool Testdata
{
get { return testdata; }
set
{
testdata = value;
RaisePropertyChanged(() => Testdata);
//Debug.WriteLine("IN");
}
}
}
风景:
[Register("SettingsView")]
public class SettingsView : MvxDialogViewController
{
public SettingsView()
: base(pushing: true)
{
}
public override void ViewDidLoad()
{
var bindings = this.CreateInlineBindingTarget<SettingsViewModel>();
Root = new RootElement("Settings"){
new Section("General")
{
new BooleanElement("Testdata ON/OFF", true).Bind(bindings, t => t.Testdata)
}
};
}
}
尝试将 de booleanelement 绑定到 Testdata 属性时发生错误。
任何帮助表示赞赏!