Xamarin.iOS + MvvmCross: UIPickerView data binding, SelectedItemChanged event


UI initialization:

          

_pickerView = new UIPickerView();
_pickerView.ShowSelectionIndicator = true;
_pickerViewModel = new MvxPickerViewModel(_pickerView);
_pickerView.Model = _pickerViewModel;
_pickerViewModel.SelectedItemChanged += PickerViewModel_SelectedItemChanged;

selection changed Event:
           

_pickerViewModel.SelectedItemChanged += PickerViewModel_SelectedItemChanged;


data binding:

            

set.Bind(_pickerViewModel).For(p => p.ItemsSource).To(vm => vm.Groups);
set.Bind(_pickerViewModel).For(p => p.SelectedItem).To(vm => vm.Password.Group);

reference:

http://stackoverflow.com/questions/17646033/changing-content-of-mvxpickerviewmodel

http://stackoverflow.com/questions/18463705/mvxpickerviewmodel-bind-to-property-of-an-object

https://github.com/MvvmCross/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Touch/Views/MvxPickerViewModel.cs

http://forums.xamarin.com/discussion/5805/uipickerview-example



展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读