Ejemplo n.º 1
0
        public void DeleteBins()
        {
            List <BinViewModel> selectedlist = BinViewModels.FindAll(x => x.Selected == true);

            foreach (BinViewModel bvm in selectedlist)
            {
                DeleteBin(bvm);
                EmptySpaceViewModel esvm = new EmptySpaceViewModel(Navigation);
                esvm.Section = bvm.Section;
                esvm.Level   = bvm.Level;
                esvm.Depth   = bvm.Depth;
                esvm.OnTap  += Esvm_OnTap;
                EmptySpacesViewModels.Add(esvm);
            }
            MessagingCenter.Send(this, "Update");
        }
Ejemplo n.º 2
0
 public void FillEmptyPositions(int Sections, int Levels)
 {
     for (int i = 1; i <= Sections; i++)
     {
         for (int j = 1; j <= Levels; j++)
         {
             BinViewModel exist = BinViewModels.Find(x => x.Level == j && x.Section == i);
             if (exist is null)
             {
                 EmptySpaceViewModel existesvm = EmptySpacesViewModels.Find(x => x.Level == j && x.Section == i);
                 if (existesvm is null)
                 {
                     EmptySpaceViewModel esvm = new EmptySpaceViewModel(Navigation);
                     esvm.Section = i;
                     esvm.Level   = j;
                     esvm.Depth   = 1;
                     esvm.OnTap  += Esvm_OnTap;
                     EmptySpacesViewModels.Add(esvm);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
        public void DeleteBins()
        {
            List <BinViewModel> selectedlist = BinViewModels.FindAll(x => x.IsSelected == true);

            foreach (BinViewModel bvm in selectedlist)
            {
                DeleteBin(bvm);

                for (int i = 1; i <= bvm.SectionSpan; i++)
                {
                    for (int j = 1; j <= bvm.LevelSpan; j++)
                    {
                        EmptySpaceViewModel esvm = new EmptySpaceViewModel(Navigation);
                        esvm.Section = bvm.Section + i - 1;
                        esvm.Level   = bvm.Level + j - 1;
                        esvm.Depth   = bvm.Depth;
                        esvm.OnTap  += Esvm_OnTap;
                        EmptySpacesViewModels.Add(esvm);
                    }
                }
            }
            MessagingCenter.Send(this, "Update");
        }