今天我们讲讲Xamarin中的MVVM双向绑定,嗯..需要有一定的MVVM基础.,具体什么是MVVM - -,请百度,我就不多讲了
效果如下:
?...>
<ContentPage xmlns="http://<em>xamarin</em>.com/schemas/2014/<em>forms</em>"
xmlns:x="http://schemas.microsoft.com...很多解释我都写在了注释里面,请仔细看注释
然后我们回到<em>Xaml</em>中的BindingContext,它的作用就一目了然了,给这个<em>Xaml</em>控件,<em>绑定</em>一个上下文对象,也就是你定义的ViewModel,来方便你<em>绑定</em>其中的属性...>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com...今天主要学习了Xamarin中的MVVM双向绑定和命令绑定,
需要双向绑定的类,需要继承INotifyPropertyChanged,需要绑定的命令,需要继承:ICommand
最后,列一下可以使用命令绑定的控件