Tuesday, March 16, 2010

MIX10 Keynote: Silverlight and Windows Phone 7

Yesterday there was a unique event on Schiphol Airport in the Netherlands.

What?? Your title says you’re talking about MIX10??

Just read on, it is about MIX10. Microsoft Netherlands organized, for the first time, an official get-together for a small group of people to come together and watch the MIX10 Keynote and I was fortunate to be one of those people. This article is about the keynote and the event in the Netherlands.

The arrival

As I arrived, I was expecting to be early, but to my surprise there were already about twenty people in the lobby waiting to get to the conference room where we would watch the keynote. It struck me that this was not your typical group of developers, but more a mix of different stakeholders for the information that was going to be released. I guess that’s why they call it MIX :-).

After a couple of minutes we were escorted to the conference room where, with about 35 people we would watch the keynote. I expected more people than that, but it was a bit short notice to get a larger group together. I received my invitation on Friday.

Pre-keynote

As we entered the conference room the live feed to Las Vegas was already displayed on the beamer and we could watch the performance of the world champion in JoJo’s. Sure, it was impressive, but I did get bored about 2 minutes into that and there was at leas another 10 minutes to go.

The Keynote!

Obviously the keynote is always presented by one of the top people at Microsoft and this year it was Scott Guthrie. I was pleased as it wasn’t some commercial hot-shot who can’t go into technical details. I have great respect for Scott. He seems to know what he’s doing :-).

The first couple of minutes where all about Silverlight and the successes it has had recently. I was seriously impressed with the Winter Olympics case that was presented and I was more impressed with the fact that the source for this is being open sourced on CodePlex.

There was also the eBay demo, where they announced a Silverlight app to more easily list items. It looked smooth, but the one question that stuck was, why didn’t you do that a year ago? The technology was already there. It would have been almost just as easy in Silverlight 3.

Next was the obvious announcement of Silverlight 4 RC. The announcement that Silverlight 4 RTM will follow next month wasn’t a great shocker as well. I was happy to hear that upgrading from Expression Blend 3 to 4 is going to be free.

After this there where some demos of the Windows Phone 7. I’d seen what the Windows Phone would look like before, so I wasn’t so interested, until an announcement was made that Silverlight 4 is the major platform for the Windows Phone 7. There where demo’s and that’s great. Scott slapped together the first second tweeter app in under eight minutes and with that displayed, not the power of the Windows Phone, but the power of the Silverlight platform. For Silverlight developers it also became obvious that the model that we all know and love, is no different for the Phone.

Another great thing that came across from the demos was the emulator. It looked like it would work easily, fast and exactly the same like the actual device.

Oh, and yes, there is the Marketplace where you, as a developer, can post your Silverlight applications, decide how you want people to experience the trial version and you can start selling your app. Details are still a bit sketchy, but there will be the opportunity to monetize your apps, either through selling or through advertizing.

When they announced that the tools for developing Windows Phone 7 applications in Silverlight are, and always will be free, it all came together. This is a full frontal attack on both the iPhone and the Android platform.

The other platform

To enable developers of games to provide a greater experience, Microsoft announced that the XNA platform is fully supported on the Windows Phone 7, including XBOX Live integration. Now you can port your XBOX game to the PC AND to the Phone with a minimal amount of work. Simply a great achievement.

Some demos where given, showing games across platforms and showing off the XBOX Live integration. It looked like a powerful platform for games, which, to me as a consumer, is a great asset.

After the keynote

After the keynote ended, there was a short break with drinks and discussion about what was presented. I found out there where both Silverlight adepts and Windows Mobile developers and business owners in the room, which explained the somewhat unusual mix of people.

We where then invited to have some of the dutch people attending MIX10 in person to do a Q&A. One thing that stuck was that the model you develop in in Silverlight is the same for the Phone. There where some tough questions about the Marketplace, which seems still a bit obscure at the moment, more announcements should be available later this week. Also there where questions about push notifications through a server platform. These will be provided for free.

After about an hour of Q&A we all had some pizza and talked some more about the proposition Microsoft has for the mobile market.

Conclusions

So Microsoft is taking on the mobile market, directly attacking both the iPhone and the Android platform. The big question remains, will they succeed? If you look at the philosophy behind the new Windows Phone 7 platform, then you have to conclude it is a better thought out platform than both the iPhone and the Android platform.

The iPhone actually looses the battle in terms of usability as there is no structure holding together the applications on the phone, were as the Windows Phone 7 supplies hubs centered around tasks you want to do with your phone. Microsoft did a good job taking a long hard look at the iPhone, though. They took what are considered the strongest points on the iPhone and incorporated them into their own platform. This includes the single custom application model, the capacitive touch screen and the all important marketplace.

In comparison with the Android platform it should be easy. Android allows users to run as many processes in the background as they like and shuts down those processes when the OS determines they are no longer used. This sounds like a great plan, but in practice turns out to be a real headache for the user. It seems to be going in the direction that Windows Mobile was heading. The only huge advantage Andriod has is that it’s open. This means that any vendor, any developer and any operator can do Android. Microsoft has given a very strict set of specifications that phones need to adhere to.

Basically they chose to be in between the choices made for the iPhone, one vendor, limited operators and limited developers resulting in a smooth user experience, and the choices made for the Android, unlimited vendors, operators and developers resulting in a not so great user experience.

Looking at the above and at how the platform is easier monetized because of the limited investments, the only potential issue that Microsoft has, it that they are late. On the other hand this may work to their advantage. Everyone experienced the good and bad of the other platforms before Microsoft comes with a more balanced solution. The future will show us.

A final word as a Silverlight Developer. Thank you, Microsoft, for making my personal investments in Silverlight worth while. And thank you, for providing us with free tools.

Wednesday, March 10, 2010

Adventures while building a Silverlight Enterprise application part #32

Today we want to look at a pitfall when debugging certain data binding code. But first I have some other stuff I wanted to share with you.

It’s been over a month. Where have you been?!?

I’m sorry I couldn’t post in the past month. I’ve been really busy with a lot of different stuff. As you might already know, I’m having a new house built and it takes a lot of my free time.

My working time has been busy as well. I have a new role as team lead for a small team now, which took a lot of time to prepare for. Also I’ve been training a group of people to build software with our new framework. All in all, it’s been a hectic time and I don’t think much will change in the next couple of months.

So you’ve been completely off the grid?

Well, not completely. I’ve written my second article for SilverlightShow.net, which you can find here. The article describes how I built a simple interactive spider, that uses JQuery from Silverlight to get pages from the web. There is some nice code to parse HTML to get links and there is a simple but effective data binding trick in there, so go check it out.

Also, I’ve done some thinking about where to go with this blog. One of the things I’ve decided is that I will stop development on CodeEmbed4Web as I found there are better ways of embedding code in my blog posts. It will still be up for download and if anyone is interested in the source, drop me a line.

But enough about all that, let’s get down to business.

Warning! Debugging can be hazardous for your health and it can even be deadly!

So here is the case. I was working on a feature in our application, where I needed some code to run whenever a certain property was set by the user. I went and tested my code and everything worked as expacted, until…

…I first entered a new value in a TextBox control and right after that I clicked a HyperlinkButton which should trigger code to save the change I made. Because of a breakpoint in the previously mentioned code, I ended up in Visual Studio. I pressed F5 to continue running the application and then I checked to see if my change was actually saved and to my surprise, it wasn’t!

I placed a breakpoint in the clicked event of the HyperlinkButton and tested again, only to find out that the clicked event never fired. I went on and started debugging the whole code trail that should have let up to the click event, but with no luck.

Eventually I decided to build a small test application, as I find them easier to analyze. I tried replicating the same behavior, but the only way I could get it not to register the clicked event, was by showing a MessageBox whenever the user changed a value right before clicking the HyperlinkButton. So I went back to the original application and tried to find any code that might have a similar impact and I obviously came back empty handed.

Finally, after trying out different controls, changing properties, etc., I decided to remove all the breakpoints from my code and try again. All of a sudden everything worked! As it turns out, debugging code that is triggered before a click event (like data binding code, which is triggered as a result of loosing focus, which is executed first), will prevent the click event from firing. Thinking about it, it all makes sense, but when you’re debugging it, it doesn’t. Debugging is deadly!