Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6587933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:58:57+00:00 2026-05-25T16:58:57+00:00

I am a newbie in windows phone app and need to create a small

  • 0

I am a newbie in windows phone app and need to create a small Windows Phone 7 app. The app will perform the following task

  1. App Screen has an image “image1′ ,when i press on ‘image1’ it will shows a second image ‘image2’

  2. When I press on image2 it will shows image1 and so on

My XAML code

 <Button Click="Button_Click">
<Image Source="resourse/image1.jpg"/>
 </Button>

C# code

namespace Test
{
    public partial class MainPage : PhoneApplicationPage
    {

        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
          // here will shows the 'image2' and also give click event to turn 'image1'
        }




    }
}

Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:58:58+00:00Added an answer on May 25, 2026 at 4:58 pm

    I would tackle this by having a couple of images in your XAML:

     <Button Click="Button_Click">
         <Grid>
           <Image x:Name="imageOne" Source="resourse/image1.jpg"/>
           <Image x:Name="imageTwo" Source="resourse/image2.jpg"
                  Visibility="Collapsed"/>
         </Grid>
      </Button>
    

    The use of x:Name causes visual studio to generate a field for each image. The second image is ‘collapsed’, i.e. hidden.

    You click handler then does the following:

        private void Button_Click(object sender, RoutedEventArgs e)
        {
          if (imageOne.Visisbility == Visibility.Visible)
          {
            imageOne.Visisbility = Visibility.Collapsed
            imageTwo.Visisbility = Visibility.Visible
          }
          else
          {
            imageOne.Visisbility = Visibility.Visible
            imageTwo.Visisbility = Visibility.Collapsed
          }
        }
    

    On each click it toggled the visibility of each image.

    This is easier than changing the Source of the image, which involves URIs etc…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an Android platform newbie looking to port some of my Windows Phone 7
I'm using visual studio 2010 do developt my Windows phone application! I'm newbie and
I am a newbie in windows forms and I need to store a string
I am trying to create a Button in Windows phone 7 without making use
newbie with windows gui programming here. Has Anyone got an idea how to resize
Newbie to windows scripting. I need help running the .bat file on the command
I am a newbie in windows phone 7 development. In my project, I add
I am a newbie in windows phone 7. WHen I add a new windows
I am a newbie in windows phone 7. I want to do some demo
I'm a newbie in windows phone development, so excuse me if my question is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.