Quick question, if I may.
Basically, I have a method which throws images on to the screen. But….The images don’t get placed when I want them to.
This is the code:
leafArray[0].Margin = new Thickness(0, 32, 0, 0);
leafArray[1].Margin = new Thickness(109, 32, 0, 0);
leafArray[2].Margin = new Thickness(204, 32, 0, 0);
leafArray[3].Margin = new Thickness(240, 32, 0, 0);
leafArray[4].Margin = new Thickness(309, 32, 0, 0);
leafArray[5].Margin = new Thickness(446, 32, 0, 0);
for (int i = 0; i < leafArray.Length; i++)
{
LayoutRoot.Children.Add(leafArray[i]);
}
Now….the images DO show on the emulator…but they are not where I told them to be! Rather, that are always on the top right hand side…It’s almost as if they are placing themselves there because there is a container there. Which there obviously isn’t! I only have a single panel…RootPanel.
Any help will be highly appreciated! Thank you!
You could try to use Canvas instead of Grid.
And before showing your image try this
Your LayoutRoot has to be a Canvas on the XAML code