Example #1
0
 void RemoveMonkey(Oven monkey)
 {
     if (Ovens.Contains(monkey))
     {
         Ovens.Remove(monkey);
     }
 }
Example #2
0
        public OvenViewModel()
        {
            source = new List <Oven>();
            CreateMonkeyCollection();

            CurrentItem = Ovens.Skip(3).FirstOrDefault();
            OnPropertyChanged("CurrentItem");
            Position = 3;
            OnPropertyChanged("Position");
        }
Example #3
0
        void FilterItems(string filter)
        {
            var filteredItems = source.Where(monkey => monkey.Name.ToLower().Contains(filter.ToLower())).ToList();

            foreach (var monkey in source)
            {
                if (!filteredItems.Contains(monkey))
                {
                    Ovens.Remove(monkey);
                }
                else
                {
                    if (!Ovens.Contains(monkey))
                    {
                        Ovens.Add(monkey);
                    }
                }
            }
        }