Exemple #1
0
 public ItemAddVM(SupplyDisplayVM parent)
 {
     this.parent = parent;
 }
Exemple #2
0
 public EditSupplyVM(SupplyDisplayVM parent)
 {
     Parent = parent;
 }
        private void SelectionEvent(object obj)
        {
            if (SelectedItemPet == "Pets with Feet")
            {
                PetDisplayVM petDisplay = new PetDisplayVM();

                foreach (Pets ListItem in new ObservableCollection <Pets>(petDisplay._PetsCollection))
                {
                    if (ListItem is LandPet)
                    {
                        FilteredList.Add(ListItem);
                    }
                }

                if (_SelectedItemSupply != null)
                {
                    if (SelectedItemSupply == "Bedding")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Beds)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                    else if (SelectedItemSupply == "Clothes")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Clothes)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                    else if (SelectedItemSupply == "Food")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Food)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                }
            }
            else
            {
                PetDisplayVM petDisplay = new PetDisplayVM();

                foreach (Pets ListItem in new ObservableCollection <Pets>(petDisplay._PetsCollection))
                {
                    if (ListItem is WaterPet)
                    {
                        FilteredList.Add(ListItem);
                    }
                }

                if (_SelectedItemSupply != null)
                {
                    if (SelectedItemSupply == "Bedding")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Beds)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                    else if (SelectedItemSupply == "Clothes")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Clothes)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                    else if (SelectedItemSupply == "Food")
                    {
                        SupplyDisplayVM supplyDisplay = new SupplyDisplayVM();

                        foreach (Supplies ListItem in new ObservableCollection <Supplies>(supplyDisplay._SupplyCollection))
                        {
                            if (ListItem is Food)
                            {
                                FilteredList.Add(ListItem);
                            }
                        }
                    }
                }
            }


            FilteredVM filteredVM = new FilteredVM(this);
            Filtered   filter     = new Filtered
            {
                DataContext = filteredVM
            };

            filter.Show();
        }