I want to display a grid of images. Initially the grid will be empty and then it will gradually fill in as the images arrive from an external device, possibly in random order, i.e., I may get the image for location (1,3) and then (5,5) etc.
The dimensions will be known at runtime, but before I display the grid, so I have to set them programmatically, not in the XAML.
1. The examples I've found on the web show how to define Grid rows and columns in XAML, but how do I do it programmatically in C#, i.e., if a 5x4 Grid is specified I want to the user to see an empty 5x4 Grid initially.
2. How do I programmatically access/alter elements at individual grid locations? When the grid is empty I'll want to initially show something in each empty spot (like an "X" or a colored rectangle) and then replace it with the actual image when it arrives. In C# how do I access Grid location (x,y) to add or change what's in it?
3 Do Grids have any intrinsic scrolling ability or do I have to wrap them in a separate scrolling control, i.e.,
<ScrollViewer>
<Grid>
</Grid>
</ScrollViewer>
... and if I do this can I set it for scrollbars to only appear if they are needed based on the size?