Empty binding target passed to MvxTargetBindingFactoryRegistry

331 views Asked by At

I am trying to bind Dialog elements using MVVMCross but I get the following error message in my log:

MvxBind:Error: 76.84 Empty binding target passed to MvxTargetBindingFactoryRegistry MvxBind:Warning: 76.95 Failed to create target binding for binding for TextProperty

The binding isn't working but I don't know what I miss:

My Dialog View Controller

partial class SearchFilterView : MvxDialogViewController
{
    public override void ViewDidLoad()
    {
        // Associate the ViewModel to this View. Must be called before the base.ViewDidLoad().
        this.Request = new MvxViewModelRequest<SearchFilterViewModel>(null, null, new MvxRequestedBy());
        base.ViewDidLoad();

        AppHelper.SetBrandings(NavigationController, TableView);

        var bindings = this.CreateInlineBindingTarget<SearchFilterViewModel>();
        Debug.Print("ViewModel: {0}", ViewModel);

        Root = new RootElement("Example Root")
        {
            new Section("Your details")
            {
                new EntryElement("Login", "Enter Login name").Bind(bindings, vm => vm.TextProperty),
                new EntryElement("Password", "Enter Password", "", true).Bind(bindings, vm => vm.PasswordProperty)
            },
            new Section("Debug Info")
            {
                new StringElement("Given Login").Bind(bindings, vm => vm.TextProperty),
                new StringElement("Given Password").Bind(bindings, vm => vm.PasswordProperty)
            }
        };
    }
}

My View Model

public class SearchFilterViewModel : MvxViewModel
{
    private string _textProperty;
    public string TextProperty
    {
        get { return _textProperty; }
        set { _textProperty = value; RaisePropertyChanged(() => TextProperty); }
    }


    private string _passwordProperty;
    public string PasswordProperty
    {
        get { return _passwordProperty; }
        set { _passwordProperty = value; RaisePropertyChanged(() => PasswordProperty); }
    }
}

I used the examples from MVVMCross-Tutorials -> Dialog Examples but I don't see anything I have missed.

How to get this working?

0

There are 0 answers