From 18e2eb092c18daed6bfc114a429966348fc98eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulski?= Date: Mon, 1 Apr 2019 23:47:13 +0200 Subject: [PATCH] =?UTF-8?q?Wy=C5=9Bwietlanie=20=C5=9Amieciary=20na=20drugi?= =?UTF-8?q?m=20gridzie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CzokoŚmieciarka.WPFv2/MainWindow.xaml | 6 +++--- .../CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs | 13 ++++++++++++- .../Models/GarbageCollector.cs | 8 +++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml index b21a30d..baadeee 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml @@ -8,8 +8,8 @@ Title="MainWindow" Height="800" Width="1000"> - - - + + + diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs index 5e113fa..5f10668 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/MainWindow.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using CzokoŚmieciarka.DataModels.GeneralModels.Models; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; using CzokoŚmieciarka.DataModels.Models; using CzokoŚmieciarka.WPFv2.Interfaces; using CzokoŚmieciarka.WPFv2.Models; @@ -39,6 +40,10 @@ namespace CzokoŚmieciarka.WPFv2 row = new RowDefinition(); Board.ColumnDefinitions.Add(column); Board.RowDefinitions.Add(row); + column = new ColumnDefinition(); + row = new RowDefinition(); + CollectorBoard.ColumnDefinitions.Add(column); + CollectorBoard.RowDefinitions.Add(row); for (int j = 0; j < Columns; j++) { Road road = new Road(); @@ -57,7 +62,6 @@ namespace CzokoŚmieciarka.WPFv2 } - Board.ShowGridLines = true; for(int rows = 0; rows < 3; rows++) { row = new RowDefinition(); @@ -70,6 +74,13 @@ namespace CzokoŚmieciarka.WPFv2 CollectorInfo.ColumnDefinitions.Add(column); } CollectorInfo.ShowGridLines = true; + IEnumerable GarbageCollectorContainers = new List(); + WPFGarbageCollector garbageCollector = new WPFGarbageCollector(new Coords(2,1), GarbageCollectorContainers); + Grid.SetRow(garbageCollector.Image, garbageCollector.Position.Y); + Grid.SetColumn(garbageCollector.Image, garbageCollector.Position.X); + CollectorBoard.Children.Add(garbageCollector.Image); + CollectorBoard.ShowGridLines = true; + } } } diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs index ba5b121..d4fbc1d 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/GarbageCollector.cs @@ -21,9 +21,11 @@ namespace CzokoŚmieciarka.WPFv2.Models public WPFGarbageCollector(Coords startPosition, IEnumerable trashContainers) : base(startPosition, trashContainers) { ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png"; - Image = new Image(); - Image.Source = - new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png")); + Image = new Image + { + Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + + @"..\..\Images\garbageCollector.png")) + }; } } }