Android中的MVVMCross绑定不起作用

知识为进步之母,而进步又为富强之源泉。这篇文章主要讲述Android中的MVVMCross绑定不起作用相关的知识,希望能为你提供帮助。
我是MVVMCross的新手,我在here中重写了演示代码:,没有改变太多,但绑定的东西不起作用,它应该显示调试的错误日志。我还阅读了命名约定这是我的viewmodel类

public class FirstViewModel:MvxViewModel { private string _firstName; private string _lastName; public string FirstName { set { SetProperty(ref _firstName, value); RaisePropertyChanged(() => FirstName); } get { return _firstName; } }public string LastName { set { SetProperty(ref _lastName, value); RaisePropertyChanged(() => LastName); } get { return _lastName; } }public string FullName { get { return string.Format("{0} {1}", _firstName, _lastName); } } }

视图:
public class FirstView : MvxActivity< FirstViewModel> { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.FirstView); } }< ?xml version="1.0" encoding="utf-8"?> < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> < EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="40dp" local:MvxBind="Text FirstName" /> < EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="40dp" local:MvxBind="Text LastName" /> < TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="40dp" local:MvxBind="Text FullName" /> < /LinearLayout>

答案【Android中的MVVMCross绑定不起作用】只需更改这些代码行就可以了:
RaisePropertyChanged(() => FullName RaisePropertyChanged(() => FullName


    推荐阅读