windows - Changing the Source of an Image in XAML through C# -


so have grid name game (the main game board) wanna load every image inside grid when program loads

foreach(image myimage in game.children)             {                 bitmapimage bi3 = new bitmapimage();                 bi3.urisource = new uri("ms-appx:///assets/smalllogo.png");                 myimage.stretch = stretch.fill;                 myimage.source = bi3;             } 

i using foreach error messages. tried lot of different methods none worked far. trying make matching memory game. in advance

the child of grid stackpanel, not image itself. you'll need dig in deeper stackpanel. if share xaml it'll easier tell, i'm guessing images datacontext of 1 of contents in stackpanel.

share xaml if you're still running issues


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -