Пример #1
0
        protected override void OnAppearing()
        {
            PopUpCheakListBoxWaterproofingViewModel vm = (PopUpCheakListBoxWaterproofingViewModel)this.BindingContext;

            if (vm.CheakBoxSelectedItems.Count != 0)
            {
                foreach (var item in vm.CheakBoxSelectedItems)
                {
                    vm.Items.Where(c => c.Name == item).Single().IsSelected = true;
                }
            }

            base.OnAppearing();
        }
Пример #2
0
        void btnDone_Clicked(System.Object sender, System.EventArgs e)
        {
            PopUpCheakListBoxWaterproofingViewModel vm = (PopUpCheakListBoxWaterproofingViewModel)this.BindingContext;

            vm.CheakBoxSelectedItems = new System.Collections.ObjectModel.ObservableCollection <string>();
            //List<Cheac response = new CheakBoxListReturntModel();
            foreach (var item in vm.Items)
            {
                if (item.IsSelected == true)
                {
                    // response.selectedList.Add(item.Name);
                    vm.CheakBoxSelectedItems.Add(item.Name);
                }
            }
            //response.Count = vm.Items.Where(c => c.IsSelected == true).Count();

            MessagingCenter.Send(this, "SelectedItem", vm.CheakBoxSelectedItems);
            vm.GoBackCommand.Execute(null);
        }