What am I doing wrong...unable to bind model to the view in the view model

I have a property in my viewmodel which is a model and I am trying to bind it to the view. I have set the bindingcontext in the code behind of the view to the viewmodel, however the model doesn't seem to update and everything is null. I have some code below...Any Idea what I am doing wrong here?

VIEW code behind
AddNewContactVM = new AddNewContactViewModel();
BindingContext = AddNewContactVM;

VIEW


VIEWMODEL
private ContactModel _oContactModel;
public ContactModel oNewContact
{
get
{
return _oContactModel;
}
set
{
_oContactModel = value;
OnPropertyChanged("oNewContact");
}
}

Answers

  • ChrisVardonChrisVardon GBMember ✭✭
    edited January 2017

    Missing in the view section was this:

    EntryCell Text="{Binding oNewContact.FirstName, Mode=TwoWay}"

  • WinterCloudWinterCloud GBMember ✭✭✭

    very confusing, don't know what you trying to do. You have to post your code for clearer understanding.

Sign In or Register to comment.