Zmiana pola Image w modelach

This commit is contained in:
Michał Dulski 2019-04-18 00:43:48 +02:00
parent 57c53b9bdb
commit 9aaa79a5c5
3 changed files with 42 additions and 28 deletions

View File

@ -18,19 +18,23 @@ namespace CzokoŚmieciarka.WPFv2.Models
{
class WPFGarbageCollector : AGarbageCollector, IWPFObject, INotifyPropertyChanged
{
public Image Image
{
get
{
return new Image
{
Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png"))
};
}
}
public Image Image { get; set; }
//{
// get
// {
// return new Image
// {
// Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png"))
// };
// }
//}
public WPFGarbageCollector(Coords startPosition, IEnumerable<AGarbageCollectorContainer> trashContainers, int columns, int rows) : base(startPosition, trashContainers, columns, rows)
{
Image = new Image()
{
Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png"))
};
}
public event PropertyChangedEventHandler PropertyChanged;

View File

@ -17,17 +17,21 @@ namespace CzokoŚmieciarka.WPFv2.Models
{
public Coords Coords { get; set; }
public IEnumerable<ATrashCan> TrashCans { get; set; }
public Image Image { get {
return new Image
{
Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png"))
};
} }
public Image Image { get; set; }
//{ get {
// return new Image
// {
// Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png"))
// };
// } }
public WPFHouse(Coords coords, IEnumerable<ATrashCan> trashCans)
{
Image = new Image()
{
Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png"))
};
TrashCans = trashCans;
Coords = coords;
}

View File

@ -13,20 +13,26 @@ namespace CzokoŚmieciarka.WPFv2.Models
{
class Road : IWPFObject
{
public Image Image
{
get
{
return new Image
{
Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"))
};
}
}
public Coords Coords { get; set; }
public Image Image { get; set; }
//{
// get
// {
// return new Image
// {
// Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"))
// };
// }
//}
public Road()
{
}
Image = new Image()
{
Source =
new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"))
};
}
public Coords Coords { get; set; }
}
}