2019-03-20 18:27:11 +01:00
|
|
|
|
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;
|
2019-03-27 01:11:14 +01:00
|
|
|
|
using CzokoŚmieciarka.DataModels.Enums;
|
2019-03-20 18:27:11 +01:00
|
|
|
|
using CzokoŚmieciarka.DataModels.Interfaces;
|
|
|
|
|
using CzokoŚmieciarka.DataModels.Models;
|
2019-03-26 22:47:45 +01:00
|
|
|
|
using CzokoŚmieciarka.WPF.Interfaces;
|
2019-03-20 18:27:11 +01:00
|
|
|
|
|
|
|
|
|
namespace CzokoŚmieciarka.WPF.Models
|
|
|
|
|
{
|
2019-03-26 22:47:45 +01:00
|
|
|
|
class DumpWPF : AObject, INotifyPropertyChanged
|
2019-03-20 18:27:11 +01:00
|
|
|
|
{
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
2019-03-27 01:11:14 +01:00
|
|
|
|
public Trash Trash;
|
|
|
|
|
public DumpWPF(int columns, Coords location, Trash trash)
|
2019-03-20 18:27:11 +01:00
|
|
|
|
{
|
|
|
|
|
Location = new Coords(location.X, location.Y * columns);
|
2019-03-27 01:11:14 +01:00
|
|
|
|
Trash = trash;
|
|
|
|
|
switch (Trash.Type)
|
2019-03-20 18:27:11 +01:00
|
|
|
|
{
|
2019-03-27 01:11:14 +01:00
|
|
|
|
case GarbageType.Glass:
|
2019-03-20 18:27:11 +01:00
|
|
|
|
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png";
|
|
|
|
|
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
|
2019-03-27 01:11:14 +01:00
|
|
|
|
Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight);
|
2019-03-20 18:27:11 +01:00
|
|
|
|
break;
|
2019-03-27 01:11:14 +01:00
|
|
|
|
case GarbageType.PlasticMetal:
|
2019-03-20 18:27:11 +01:00
|
|
|
|
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png";
|
|
|
|
|
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
|
2019-03-27 01:11:14 +01:00
|
|
|
|
Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight);
|
2019-03-20 18:27:11 +01:00
|
|
|
|
break;
|
2019-03-27 01:11:14 +01:00
|
|
|
|
case GarbageType.Organic:
|
2019-03-20 18:27:11 +01:00
|
|
|
|
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png";
|
|
|
|
|
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
|
2019-03-27 01:11:14 +01:00
|
|
|
|
Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight);
|
2019-03-20 18:27:11 +01:00
|
|
|
|
break;
|
2019-03-27 01:11:14 +01:00
|
|
|
|
case GarbageType.Paper:
|
2019-03-20 18:27:11 +01:00
|
|
|
|
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png";
|
|
|
|
|
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
|
2019-03-27 01:11:14 +01:00
|
|
|
|
Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight);
|
2019-03-20 18:27:11 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|