I have a grid where I'm going to add images dynamically in code-behind. I need to set the ZIndex properties of those images to get the desired look.
I don't want to use Canvas if there's a way without it, the grid already contains images that are transformed in animations and adding a canvas messed up their positions immediately. I can set the ZIndex property in XAML, so I assume it is possible in code-behind as well.
How can I change a the ZIndex property of an image in a grid in code-behind?