Multi Scale Images using #wp7 touch features!

Alright in my last post I pointed out how you could simply use Zoom.It by Live Labs inside of your windows phone 7 project. Where just a few moments ago @LocalJoost on twitter wrote a very good tutorial on his blog about using WP7’s multi-touch pan/zoom behaviors with the MSI control. You might want to check it out and apply it to your application for better results rather than using the touch controls I was playing with.

WP7 – Apply a BackGround Image to all of your Pages.

I am currently working on a small application for the windows phone 7, and it’s more of a port of a couple of the iPhone/iPod Touch apps into one. However one thing I couldn’t figure out was how to apply the same background image to several pages with one simple piece of code. I searched the web for this several times but couldn’t find anything so I went in digging. Here is what I found.

  1. Open your application or create a new Windows Phone 7 Application.
  2. Open your frame page named “App.xaml”.
  3. Scroll down till you get to the “Brush Resources” Section and delete this line from the code:<SolidColorBrush x:Key=”PhoneBackgroundBrush” Color=”{StaticResource PhoneBackgroundColor}”/>
  4. Now Add this Piece of code to your app replacing “Background.png” with the URL of your background image.<ImageBrush x:Key=”PhoneBackgroundBrush” ImageSource=”Background.png” />

  5. Don’t forget to save your document then Press F5 and run that application to see it in effect.

Background Image Project Running In WP7 Emulator