Dodano event OnKeyDown

This commit is contained in:
Michał Dulski 2019-04-02 16:14:33 +02:00
parent 18e2eb092c
commit 3613cad37f

View File

@ -29,6 +29,9 @@ namespace CzokoŚmieciarka.WPFv2
public static int Columns = 9;
public static int Rows = 9;
IWPFObject[,] Objects = new IWPFObject[Columns,Rows];
private IEnumerable<AGarbageCollectorContainer> GarbageCollectorContainers;
private WPFGarbageCollector garbageCollector;
public MainWindow()
{
ColumnDefinition column;
@ -74,13 +77,23 @@ namespace CzokoŚmieciarka.WPFv2
CollectorInfo.ColumnDefinitions.Add(column);
}
CollectorInfo.ShowGridLines = true;
IEnumerable<AGarbageCollectorContainer> GarbageCollectorContainers = new List<AGarbageCollectorContainer>();
WPFGarbageCollector garbageCollector = new WPFGarbageCollector(new Coords(2,1), GarbageCollectorContainers);
GarbageCollectorContainers = new List<AGarbageCollectorContainer>();
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;
}
private void MainWindow_OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
}
}
}
}