using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Windows.Media.Imaging; using CzokoŚmieciarka.DataModels.Enums; using CzokoŚmieciarka.DataModels.Interfaces; using CzokoŚmieciarka.DataModels.Models; using CzokoŚmieciarka.WPF.Interfaces; namespace CzokoŚmieciarka.WPF.Models { class DumpWPF : AObject, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public Trash Trash; public DumpWPF(int columns, Coords location, Trash trash) { Location = new Coords(location.X, location.Y * columns); Trash = trash; switch (Trash.Type) { case GarbageType.Glass: ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png"; Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); break; case GarbageType.PlasticMetal: ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png"; Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); break; case GarbageType.Organic: ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png"; Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); break; case GarbageType.Paper: ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png"; Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); break; } } } }