-
November 15th, 2010, 08:58 PM
#1
Toggle Image source using only XAML
Hey all
This is my first post on CodeGuru - first of many, I hope. ![Smilie](images/smilies/smile.gif)
I need some help. I have an assignment where I have to write a WPF application, but I'm only allowed to code in XAML - no C# code. Somehow, using just XAML, I have to make a window application where clicking an image toggles the image source of that image, as well as the source of another image.
So say there are two images: Image1 and Image 2. Initially:
Image1.Source = "A.bmp"
Image2.Source = "B.bmp"
But when Image1 is clicked, the following happens:
Image1.Source = "C.bmp"
Image2.Source = "D.bmp"
And when Image1 is clicked again, the image sources revert to "A" and "B" respectively etc.
Doing this in C# is no problem, but I'm confused as to how it's even possible in XAML. I'm guessing it's something along the lines of using styles and triggers, but I can't get anything to work. Any tips would be very helpful! Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|