I am developing on alarm based application I want to add one setting page to my app. I want to change image of Image control which is on my Mainpage. image should be changing when button click event occurs from setting page. All Images are stored in my simple local folder of application like assets folder. please help me
Asked
Active
Viewed 114 times
2 Answers
0
So you could do simply like this, within your button
click event handler:
BitmapImage imgSource = new BitmapImage(
new Uri("/PivotApp1;component/Images/halfstar.png", UriKind.Relative));
imageName.Source = null;//imageName is the name of the image control
imageName.Source = imgSource;
For more you could refer these:
On Button Press - Change Image Source
Imagebutton change source property
To show multiple images, you could use the image sliding
. Reference
Hope it helps!

Community
- 1
- 1

Kulasangar
- 9,046
- 5
- 51
- 82
-
but how to use it my button is in setting.xaml page and image control is in mainpage.xaml. And the other thing is how can user show all images which are stored on my projects assets folder and how user can user select one image for change from all images. please help me – sohan vanani Aug 15 '14 at 14:20
-
So you can store the image control name in a global variable, in other words in the App.xaml.cs but make sure to have that variable as static. So that you could use that string value(the image control) in your settings.xaml.cs where you could use it within the event handler. – Kulasangar Aug 15 '14 at 14:29
-
how to show all images which are stored on my assets folder ??? can you give a source or example like that – sohan vanani Aug 16 '14 at 12:39
0
If you're looking for an example of a settings page, check out my app templates: Universal version and Silverlight (WP 8.0) version - they both have a settings page and an example of how to respond to when a setting changes.

gregstoll
- 1,318
- 9
- 14