Databinding shapes with the Bing Maps control for Silverlight

The March 2009 release of the Virtual Earth control for Silverlight (now known as the bing map control) was a great release. Up until then, projects like Deep Earth were trying to provide us with a way to use deep zoom + the virtual earth tiling to allow us to build Silverlight apps. Now Microsoft have given us an official control to play with.

One of the big downsides of the official control was the lack of databinding. You still had to add / remove your pushpins & shapes manually just like you would with the AJAX version. There is code available on the Microsoft website that adds dependency properties to the Bing Maps control which expose ItemsCollection, ready for you to databind to. If you combine this with some custom datatemplates, you are able to databind directly to the map as you would expect.

Step 1. Install the Bing Maps control

The CTP of the control is available from Microsoft connect https://connect.microsoft.com/silverlightmapcontrolctp

Read the rest of this entry »

Is Google Chrome OS not going after windows at all?

There has been a lot of discussions over the new Google Chrome OS announcement lately. I just read this article Google’s Chrome OS: Maybe Not a "PC" OS After All and this paragraph caught my attention

“The OS that would drive such a system would require a lot of work beyond just hosting a browser on Linux, which may be why Google says it is a year or more away. That’s because many of the add-ons that we need to enable web sites to properly function would need to be moved from desktop applications to become a part of the OS. I’m talking about things such as media players, codecs and add-ons that support PDF and other file formats, Adobe Flash, or even Microsoft Silverlight.  Google Gears, or whatever caching technology, also needs a lot of work."

That last sentence is what caught my eye. Now it is no secret that Google have been promoting HTML5 VERY strongly. There have been a number of articles on the web since the Google conference last month about how much they are promoting HTML5, and what their motives could be. Most of the articles come to the conclusion that in the end, will we even need plugins like flash or Silverlight.

Google have made it very clear that “for application developers, the web is the platform”, implying that you won’t be able to develop for the linux kernel it is running on top of.

If you tie Google’s push for HTML5 with the Chrome OS announcement, then maybe we are onto something. Perhaps they aren’t trying to displace windows at all, but instead increase the number of devices that support HTML5 and not Silverlight / Flash / Java. They could be aiming this announcement at web developers here. When web devs are thinking what platform they should create their new web app on, they may default to using HTML5 over Silverlight because of the additional reach HTML5 is going to give them.

So there is my angle, they aren’t targeting Microsoft at the desktop, but are instead trying to dislodge them from the web and stopping adoption of Silverlight.

Silverlight on iPhone a possibility?

I came across an article Adobe cooperates with Apple on Flash for iPhone , which suggests that Apple is now working with Adobe to provide flash on the iPhone. Now previously i’d heard that this wasn’t going to happen because the apple SDK doesn’t allow the creation of other “platforms” for the iPhone. But with flash now being ported to it this now opens up the question “Could silverlight be seen on the iPhone in the future?”

Now there are 2 key differences between Flash & Silverlight

  1. Apple got into trouble because “Apple recently got into some hot water with the United Kingdom’s Advertising Standards Authority because of the iPhone’s inability to support the nearly ubiquitous Web technology. The company had been running advertisements that claimed the handset can access “all parts of the Internet,” but the agency said the ads were “misleading” because of the lack of Flash and Java support.
    As much as Microsoft tries to tell us that it is on 25% of computers, i don’t think that it could be seen as a critical thing needed to experience the web
  2. Apple & Microsoft cooperating… seriously

 

I’d love to see silverlight on the iPhone and who knows, with silverlight for mobiles being released for Nokias & windows smart phones in the near future, it may just put enough pressure on Apple to collaborate with Microsoft to get Silverlight ported to the iPhone

Update: There is an article here with more information, although the title of it is misleading since the content contradicts its own title.

Silverlight hosted on Windows Azure

There have been a lot of hits to my blog for the search term “Silverlight Azure development”. So for anybody who is stuck at this first step of getting Silverlight hosted on Windows Azure.

I’ve included steps for creating a new Silverlight project, or adding an existing one.

Read the rest of this entry »

My notes from PDC Day 2 keynote

As i mentioned, i’m going to post up all of my notes from the PDC sessions i watch.

Day 1 keynote was about the cloud
Day 2 is all about client technologies

Summary

  • Windows 7 – new UI features, improvements in performance (They demo win7 running on a tiny notepad with 1Gb of ram with ½ the ram still available!)
  • WPF Improvements – RibbonBar control, multitouch. New WPF toolkit released today with visual state manager!
  • Visual studio 2010 will be built on WPF
  • Visual studio – Web.config. Improvement to support set up debug/release/staging config files
  • Live Wave 3 – new “Live Framework” wraps around Live services
  • Live Mesh improvements – Adding support for win mobiles and Macintosh in the next update
  • Office 14 – Is now really integrated into the web with live editing of documents being synced. But now have a fully featured office web, works in IE/firefox and has ribbon bar, looks like same app

Read the rest of this entry »

Silverlight MVVM + dependency injection

Update 2009/03/04: Here are 2 links that may help you with your understanding of MVVM

first 2 videos about implementing MVVM, one in WPF and the other in Silverlight http://weblogs.asp.net/craigshoemaker/archive/2009/02/26/hands-on-model-view-viewmodel-mvvm-for-silverlight-and-wpf.aspx and an article that delves into creating a fully functional app http://www.codeproject.com/KB/smart/Sonic.aspx

 

I attended a talk Jonas did last week on MVVM and it got me excited enough to explore it myself. His blog has a wealth of information, and it has all been summarised in his latest post. By reading his blog and many other bits and pieces around the web i was able to get this working myself. I’m going to put it all together into one blog post to give a complete look at how to incorporate all of it together. I aim to show how it all hooks in together and not just show a diagram saying that you should split things out.

Presumably you already have an idea of what Model/View/ViewModel is. The background and reasoning behind it is beyond the scope of this article, but here is an article I recommend. And also all of Jonas’s articles. But basically MVVM + Dependency injection allows your applications to be loosely coupled with the GREAT advantage that all of your code can now be unit tested, since the UI is just databinding to your classes.

Architecture

MVVM

The application is going to look like the diagram. It will be split up into the usual Model/View/ViewModel components, but I aim to show all of the supporting code that is needed to get it all working.

The application will be a HR system which just show a list of all the employees. I am just going to implement this single method to try and keep this example as simple as possible

Read the rest of this entry »