Czoko_Smieciarka/Trunk/Interface/CzokoŚmieciarka.WPF/Models/DumpWPF.cs
2019-03-20 18:27:11 +01:00

53 lines
2.1 KiB
C#

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.Interfaces;
using CzokoŚmieciarka.DataModels.Models;
namespace CzokoŚmieciarka.WPF.Models
{
class DumpWPF : IObject, INotifyPropertyChanged
{
public Coords Location { get; set; }
public string ImagePath { get; set; }
public string Data { get; set; }
public ImageBrush Image { get; set; }
public ITypeOfGarbage TypeOfGarbage { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public DumpWPF(int columns, Coords location, ITypeOfGarbage typeOfGarbage)
{
Location = new Coords(location.X, location.Y * columns);
TypeOfGarbage = typeOfGarbage;
switch (TypeOfGarbage.GarbageType)
{
case "glass":
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png";
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
Data = "Szkło";
break;
case "plasticmetal":
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png";
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
Data = "Plastiki i metale";
break;
case "organic":
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png";
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
Data = "Organiczne";
break;
case "paper":
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png";
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
Data = "Papier";
break;
}
}
}
}