Archives / 2010 / November
  • Programmatic access to Windows Phone FM tuner

    Windows Phone 7 has the FMRadio class (Microsoft.Devices.Radio namespace) that is ready to use:

    FMRadio.Instance.PowerMode = RadioPowerMode.On; 

    but… there are couple of things to know:

    The first time you will use it, chances are that you will get an UnauthorizedAccessDenied exception with an obscure "Access is denied" message.

    The problem is that the Zune software must be closed….  but if you close Zune, now when you try to build or debug (F5 or Ctrl+F5) Visual Studio complains that it can’t deploy to the device anymore: “Zune software is not launched. Retry after making sure that Zune software is launched.”

    So… you need to deploy the app to the device and then close Zune, debugging might be a problem as if you hit F5 then close Zune, the app will stop; but instead you can right-click on your project and select “Deploy”:

    Now you can close Zune and it should be ok, but the FM Radio only works with headset plugged or you’ll get an error notification. You can check this by code:


        FMRadio fmRadio = FMRadio.Instance;
        fmRadio.PowerMode = RadioPowerMode.On;
        fmRadio.CurrentRegion = RadioRegion.UnitedStates;
        fmRadio.Frequency = 99.5;
        if (FMRadio.Instance.SignalStrength == 0.0)
            MessageBox.Show("Please connect your headset.");
    catch (Exception ex)
        MessageBox.Show(String.Format("Error: {0}\nClose the Zune
    software or disconnect the phone from your computer."
    , ex.Message));


    Also check the Marketplace application certification requirements document, as you need to follow some guidelines while your app plays music, like updating the “History” area of the Music hub, or asking the user his permission to play music in background.


    Note: I was not able to make FM Radio works in the emulator, some people report that it may take long (minutes) to launch…but for me it keeps telling that headset are not connected.


    Download my code sample

  • Last Silverlight Training of the year! [Montreal]


    Last chance to get this awesome Silverlight training in 2010! The Silverlight Tour has one more class in Montreal, and provide top Silverlight 4

    >> This course will be taught in French * <<

  • What: Silverlight training
  • When: December 14-17 (4 days)
  • Where: Montreal, Qc
  • Registration/info:

    Also note that we offer a free license of Telerik's RadControls for Silverlight to every attendee ($999 value)!!
    For more information on RadControls, visit:

    * We do english class as well… check our website!

  • Local Silverlight Firestarter in Montreal (free event)

    alt I already post about this event, but want to mention that we will host a local event in Montreal.

    What: From the official event “The future of Silverlight. Hear what’s coming next from Microsoft’s Scott Guthrie. It’s just like an extra day of PDC, dedicated to Silverlight”.
    We will watch the keynote live from the Microsoft local office in Montreal, then discuss about it.

    : December 2, from noon to 2pm.

    Where: 2000 McGill College, 4th floor, Montreal, QC, H3A 3H3

    More info:

    Bring your lunch, see you there!

  • My LightSwitch session at TechDays Montreal

    Today I did a presentation on Visual Studio LightSwitch at TechDays Montreal.

    My goal was to introduce this new tool and show how it can help you create business applications for the desktop or the cloud.

    I had a few slides, then fired VS2010 and created live an application (TechDays conference manager) from scratch, showing:

    • Designer to create the Db tables
    • Wizards to create the UI (automatic screens layout)
    • Built-in insert/edit/delete with validation
    • Built-in sort, pagination and Excel export
    • Custom validation
    • Computed columns
    • Customize a Search screen with a DatePicker
    • Customize the Menu (groups)
    • Security
      • Users, Roles and Permissions
      • Screens Access control

    It was great and I hope people liked it.

    Interesting links:

    Note that I’ll do another LightSwitch presentation on April 18 at the Montreal .NET Community.

    Download the slides *

    Download the app (LightSwitch beta 1)


    * Thanks to Orville McDonald for the slides!

  • My Windows Phone app in the Marketplace

    My Windows Phone little application

    My first WP7 app is available on the Marketplace: Morse Code Flash Light.

    Try it, it’s free.

    Morse Code WP7 app

    It converts any text to Morse code and use your phone as a flashlight to 'read' it.
    Features supported (v1.0):

    • Translate text in Morse code
    • Display it by flashing your screen
    • Change speed (“official” morse speed is 100ms per dot)
    • Repeat function
    • “Shake for a random word” function!
    • Support both portrait and landscape orientation
    • Optimized for dark & light themes.

    So this little piece of software was my excuse to try developing for Windows Phone 7 (and deploy it to the Marketplace). As an experienced Silverlight developer I learnt quite a few things specific to the phone, so this was an interesting experience and I can’t wait to build more mobile apps for this platform!


    My Experience (and a few tips)

    Very good! Windows Phone dev is not surprising at first, you get all the goodness of developing with Visual Studio 2010, C#, .NET, Silverlight… but you need to apply this to a phone, with very specific constraints (screen real estate, performance, touch, …), hopefully you can find plenty of resource to help (read my conclusion below).

    Here are a few things that comes out of my mind right now:

    • The best way to test your app in the emulator seems to set zoom level to 66%.
    • No implicit Style surprised me at first (too used to SL4…) but that’s not a big deal.
    • No binding on Dependency Object (same as above)
    • Forget about hyperlinks… you need buttons, big buttons in this touch world.
    • I can’t find a way to localize the splash screen, as it is not like browser Silverlight in browser, the phone rely on a SplashScreenImage.jpg picture.
    • While testing in the emulator, you can toggle virtual/physical keyboard with these shortcuts: page up / page down.
    • Cyclic navigation is discouraged. This was the most difficult part to understand at first. Navigate Home Page/Page 2/Page 3/Home Page, then hit Back button… you need to leave the app (and not back to Page 3). Avoid forward navigation, go back if needed, but you don’t have access to the navigation history, so there is no built in solution here, after 2 failures to pass Marketplace certification, it leads me to delete my common app menu bar… I just have 3 pages in my app: Home/Morse/About, but having a menu on each page with all 3 navigation buttons was a big no-no.


    My Conclusion (and a few links)

    Being a Silverlight developer does not automatically makes you a (good) Windows Phone developer, it helps for sure but you need more. You need to learn the specifics of Silverlight for the mobile platform, and there are a lot! You need to OPTIMIZE your code AND layout, even for small or basic apps, because if not you’ll get poor performance and users won’t like it. So… I think a Windows Phone developer is a good Silverlight developer... what I mean is knowing how to build good apps for the phone (limited screen real estate, limited performance, …) makes you a better Silverlight dev.

    Also... you have to learn the rules to get your app certified in the Marketplace, or you will fail to certify, promise.
    Reading this is not an option:
    Windows Phone 7 Application Certification Requirements [PDF]

    Incredible WP7 dev tips (good reading):

    Another resource you *should* read to design your WP7 apps: 
    UI Design and Interaction Guide for Windows Phone 7 v2.0 [PDF]

    Knowing your input scopes:

    And finally just in case you missed it Jeff Blankenburg did an amazing “31 days of Windows Phone 7” blog post series:


    Have fun!

  • Windows Phone 7 Developers Briefing in Montreal

    Join us at the Microsoft Windows Phone 7 Briefing for Developers!

    windows phone developer briefingsWant to learn how to create awesome applications and games for Windows Phone 7?

    Want to extend your existing apps onto a new platform?

    Want recognition, exposure, and reach in an untapped marketplace?

    RunAtServer will be presenting this Windows Phone 7 Briefing on behalf of Microsoft, you will learn more about developing on it’s latest mobile platform.  The briefing will cover three sessions exploring the two application frameworks available for Windows Phone 7, where to find developer resources, how to submit apps into Marketplace, and much more!

    Session 1
    6:00pm - 7:00pm - Apps with Silverlight
    Session 2
    7:15pm - 8:15pm - Games with XNA
    Session 3
    8:30pm - 9:00pm - Next Steps


    December 7


    Intercontinental Hotel
    360 Rue St Antoine W
    Montréal (Québec) H2Y 3X4

    Registration link

    Come and discover the world of Windows Phone programming, it’s free!