lundi 31 mars 2014

[C#/XAML][W8] how to initalize a set of random image files in c# and bind them randomly in XAML


Vote count:

0




Warning, a noob here!


I'am coding a Windows8 Metro app in which use some sort of quiz. I even don't know where to start because this is what bothers me. I have 3 sets of 10 images. I want that every time, when that page with quiz run, that program pick a picture randomly, and when a user ticks the answer, on the next page appears image #2 that is also picked randomly and so on, and so on. I'didnt write any code here, because I don't have it since i don't know where to start.


In my own head with some logic it should go something like this:




  1. in .cs there should be a method that picks some random number between 1 and 3 (i know how to do that, that is not the problem)




  2. that number represents a set of images




  3. here comes the problem, i should somehow connect that number with an image saved in my folder inside the project and bind it to XAML




  4. Every image can be selected only once in that run, so that every time i run that page i have random appearance of those images.




I hope I was not too confusing, and excuse me for my terrible english.


Best regards!



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire