Czoko_Smieciarka/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs

46 lines
1.5 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using CzokoŚmieciarka.DataModels.GeneralModels.Models;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPF.Annotations;
namespace CzokoŚmieciarka.WPF.Models
{
public class GarbageCollectorWPF : IObject, INotifyPropertyChanged
{
public Coords Location { get; set; }
public void Move(int columns, GarbageCollector garbageCollector)
{
Location.X = garbageCollector.Position.X;
Location.Y = garbageCollector.Position.Y * columns;
}
public string ImagePath { get; set; }
public string Data { get; set; }
public ImageBrush Image { get; set; }
2019-03-20 18:27:11 +01:00
public GarbageCollectorWPF(int columns,Coords location, string imagePath)
{
2019-03-20 18:27:11 +01:00
Location = new Coords(location.X, location.Y * columns);
ImagePath = imagePath;
Image = new ImageBrush(new BitmapImage(new Uri(ImagePath)));
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}