Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.bootstrapper = new SimpleActivityBootstrapper(this);
            this.bootstrapper.Run(Resource.Layout.LazyList);
            this.DataContext = this.bootstrapper.BuildDataContext <LazyListViewModel>();
            ListViewAdapter <LazyListItemViewModel> .Build(this.Items, this.DataContext.Items, this.GetAdapter, this.LayoutInflater);

            this.Items.ChoiceMode     = ChoiceMode.Single;
            this.Items.ItemClick     += Items_ItemClick;
            this.Items.ItemLongClick += Items_ItemLongClick;
        }
Beispiel #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.bootstrapper = new SimpleActivityBootstrapper(this);
            this.bootstrapper.Run(Resource.Layout.LazyListItem);
            this.DataContext = this.bootstrapper.BuildDataContext <ItemDetailViewModel>();

            this.DataContext.Item?.SetBinding <string, string>(nameof(LazyListItemViewModel.Title),
                                                               this.bootstrapper.GetView <TextView>(Resource.Id.lazylistitem_title),
                                                               targetPropertyName: nameof(TextView.Text), mode: BindingMode.OneWay);

            this.DataContext.Item?.SetBinding <string, string>(nameof(LazyListItemViewModel.Title),
                                                               this.bootstrapper.GetView <EditText>(Resource.Id.lazylistitem_edittitle),
                                                               targetPropertyName: nameof(EditText.Text), mode: BindingMode.TwoWay);
        }