Tuesday, August 24, 2010

Haven't posted in a long time! Been quite busy both in and out of work, but I'm going to get back into WP7 again :)

So I spent about an hour just...trying to get Windows Phone 7 to load an image for me...the default AddIcon.png image is available for use, but anything I added wasn't, and it was getting kind of frustrating.

Turns out that what you need to do is set the "Build Action" for the image you want to use in your project to "Content". I'm not quite sure what's so special about the one that comes with the project that allows it to be used regardless (I think the fact that it's not expecting a URI but a source object, and it uses "/{$project};component/Images/ArrowImg.png" has something to do with it), but when I find out I'll let you know...

At least I accomplished something today!

Saturday, July 24, 2010

Starting My First Windows App

I started on the next lab ("Building Your First Windows Phone 7 Application" today, and just finished the first exercise - most of it was very very similar to the Hello World lab, but importantly, navigation between pages was covered. A couple of notes:

- I'm guessing height = .8* and height = .2* means 80% and 20% of available space, respectively?

- Since the stack trace for the exception is pretty long, I thought it would be a good idea to make the error page content scrollable; this is pretty easy to do in XAML by wrapping the TextBlock in a ScrollViewer.


    
        
            
        
    


Looking up the scrolling thing I also segued into the (current lack of, but probably eventually available) Panorama control; but here's one I came cross from a proper WP7 dev.


Eventually it would also be nice to learn how to do better transitions between pages, like the OS does natively - my gut feeling is that it will involve Expressions Blend in some form or fashion :)

[ps. have a look at this site for code syntax styles, as I used above]

Expressions Blend

Finishing the second part of the first lab was very useful - I'd only really heard about Expressions Blend and hadn't really used it properly in any sort of capacity prior to the exercise, but it looks like it will be an invaluable tool for designing and implementing the general look and feel for WP7 applications - or at least, easier than writing lots of XAML to do fancy animations and flashy things :)

Friday, July 23, 2010

Hello Phone

After a pretty seamless install (I'm running on Windows 7), I was able to boot up VS2010 Express for Windows Phone without any problems.

I took the liberty of grabbing the beta refresh of the WP7 Training Kit, and ran through the first part of the Hello World sample. Here's a beautiful screenshot of my very first app! It looks different from what you're actually supposed to end up with, since I didn't copy-paste *everything* from the labs, just so I could feel like I was actually coding something.


It's all pretty basic, but if you're really really new to Silverlight/XAML like me, it's worth stepping through the first exercise of the first lab. 


Some random comments and notes:

- The emulator comes with the IE application - here's a screenshot of this blog from the app - 

I haven't quite worked out how to zoom in / do the pinch gesture on the phone, but I'm sure I'll work it out eventually. [A quick google reveals that you can zoom in by double tapping on the page; further observation reveals that the browser detects the div/container you just double tapped on, and zooms in to cover the entire element completely. This is totally awesome, and makes up for mangling the transparency for this blog :) ]

- The keyboard for the WP7 emulator doesn't seem to have the autocomplete words which I've seen in a couple of screenshots around the place. Also, if you miss it in the lab notes, you will need to hit the Pause/Break key to use your own keyboard for text entry (which will be fixed in a future version, apparently).

- You can change some of the settings of the phone emulator, such as the theme and accent, but when I tried to change the phone's region, it locks up after you tell it to "restart the phone to apply the changes"

- In case you missed the explanation around what "height=*" means, it means "fill the remainder of the available space" - which is different from auto, which only takes up as much room as required to render the contents of the grid/container. The whole process of grid layouts reminds me of Java and gridbag...

- After making a change in the code view for the MainPage and switching to designer view, don't panic if it errors and says something along the lines of "height/width must be set" - just click refresh and it'll sort itself out.

- If you were wondering about the {StaticResource PhoneFontSizeExtraLarge} properties and other similar static resource properties, a nice list of what they actually equate to can be found here.


It's definitely been lots of fun so far, and I can't wait to dive deeper into Windows Phone 7 goodness and start making some actual real-world apps - but all in good time, I suppose :)

And we're off!

Why Windows Phone 7? Being not really fond of Apple, and having an aging Nokia phone, I've been on the lookout for a new phone for quite a while. From the moment I heard about Windows Phone 7, the gorgeous new Metro UI and pretty much nothing but awesome about it, I knew instantly that it would be a perfect fit for me.

Being a developer at a very awesome company, I figured I should really stop talking about how much I like the idea of Windows Phone 7, and start doing some actual coding. As I've also been looking to upskill on XAML and Silverlight, this is pretty much killing an entire flock of birds with one stone.

I know some C#, but not much Silverlight, XNA or XAML, so there's definitely going to be some kind of learning curve here, but until the phone comes out proper later this year, the closest I'll be able to get to it is making lots and lots of apps in anticipation!

The developer tools beta package is downloading right now, as we speak...