I keep getting following errormessage:
MvxBind:Warning: 15.51 Unable to bind: source property source not found
Cirrious.MvvmCross.Binding.Parse.PropertyPath.PropertyTokens.MvxPropertyNamePropertyToken on null-object
Can't find the solution to this - since 3 hours now.
Thats the Viewmodel:
public class SettingsViewModel : MvxViewModel
{
public SettingsViewModel()
{
}
private bool testdata;
public bool Testdata
{
get { return testdata; }
set
{
testdata = value;
RaisePropertyChanged(() => Testdata);
//Debug.WriteLine("IN");
}
}
}
The View:
[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)
}
};
}
}
The error occurs while trying to bind de booleanelement to Testdata Property.
Any help appreciated!
The key part of the warning here seems to be
on null-object
By default, MvvmCross
View
s find theirViewModel
s duringViewDidLoad()
- so a solution to you current problem might be to callbase.ViewDidLoad()
: