Skalowanie okna i informacje o zawartości śmieci w śmieciarce

This commit is contained in:
Michał Dulski 2019-04-03 11:52:48 +02:00
parent 9f8d9fb785
commit 163afa21d9
2 changed files with 8 additions and 6 deletions

View File

@ -9,8 +9,8 @@
KeyDown="MainWindow_OnKeyDown">
<Grid>
<Grid Name="Board" Margin="0,0,200,0"/>
<DataGrid Name="CollectorInfo" Margin="800,0,0,0"/>
<Grid Name="CollectorBoard" Margin="0,0,200,0"/>
<DataGrid Name="CollectorInfo" HorizontalAlignment="Right" Width="192"/>
<Grid Name="CollectorBoard" Margin="0,0,200,0"/>
</Grid>
</Window>

View File

@ -71,9 +71,10 @@ namespace CzokoŚmieciarka.WPFv2
Grid.SetColumn(garbageCollector.Image, garbageCollector.Position.X);
CollectorBoard.Children.Add(garbageCollector.Image);
CollectorBoard.ShowGridLines = true;
CollectorInfo.Items.Add(garbageCollector);
CollectorInfo.Columns.Add(new DataGridTextColumn {Header="X", Binding = new Binding("Position.X")});
CollectorInfo.Columns.Add(new DataGridTextColumn { Header = "Y", Binding = new Binding("Position.Y") });
CollectorInfo.ItemsSource = garbageCollector.TrashContainers;
//CollectorInfo.Items.Add(garbageCollector);
//CollectorInfo.Columns.Add(new DataGridTextColumn {Header="X", Binding = new Binding("Position.X")});
//CollectorInfo.Columns.Add(new DataGridTextColumn { Header = "Y", Binding = new Binding("Position.Y") });
}
private void MainWindow_OnKeyDown(object sender, KeyEventArgs e)
@ -88,6 +89,7 @@ namespace CzokoŚmieciarka.WPFv2
Grid.SetRow(garbageCollector.Image, garbageCollector.Position.Y);
Grid.SetColumn(garbageCollector.Image, garbageCollector.Position.X);
CollectorBoard.Children.Add(garbageCollector.Image);
}
}
}