Phone

Session material from TechDays BE and NL

UPDATE: Added the videos Note: Like all material on this blog, this blog post and all the referenced material are licensed under the Creative Commons Attribution 3.0 Unported license. You are free to reuse material from this post and from the referenced material, but you must attribute this material to me, and link to this blog post, or to my website. Thanks! I had the chance to be invited again to speak at TechDays in Belgium (Antwerp) and in the Netherlands (The Hague), and delivered 3 sessions ......

MVVM Light V4.1.27.0 in Nuget

I just pushed a new version of MVVM Light to Nuget. The new version is 4.1.27.0. The difference towards the previous version (4.1.26.1) and this one is that I am not depending on the CommonServiceLocator Nuget package instead of providing my own. However, the CommonServiceLocator does not exist for all MVVM Light-supported frameworks. We have the following situation: WPF3.5 SP1, WPF4, WPF4.5: Depends on the CommonServiceLocator Nuget package. Silverlight 4, Silverlight 5: Depends on the CommonServiceLocator ......

Using async/await with WebClient in Windows Phone 8 (or: TaskCompletionSource saves the day)

When you share code between Windows Phone 8 and Windows 8, you can use async/await to code against asynchronous APIs, which is a nice step in the right direction. However there are Windows Phone APIs that do not support async/await yet. Probably the most annoying to date is the WebClient (which in Windows 8 has been replaced by a better API called HttpClient). Now, HttpClient’s methods support async/await. But WebClient’s methods do not support it, and so we have to resort to the old Completed event. ......

2012 in review

It seems it was only yesterday that I was writing about starting my 4th year at IdentityMine, and here we are now, more than a year later. The year 2012 has been particularly interesting for all of us in the tech space, and particularly for us who are observing the Microsoft brand. Now, those of you who know me also know that I am an undying optimist (something that is sometimes mistaken for fanboism), so I will make a big effort in adding a dose of realism into this billet. Nonetheless I think we ......

MVVM Light V4.1.26 change log

I just published the change log for MVVM Light V4.1.26, which is available on Nuget only at this time. The full version is available here, while the “libraries only” version is available here. I am working on an installer which will also add a few more changes to the templates and one bug fix in the code snippets. Stay tuned for that installer as soon as I figure a few things out. Important note: V4.1.26 is only available on Nuget (here and here) at the current time. An installer will be published ......

Displaying the Saved Pictures in the Windows Phone 8 emulator

One cool feature of the Windows Phone emulator is that it allows you to select pictures from your app (using the PhotoChooserTask) without having to try your app on a physical device. For example, this code (which I used in some of my recent presentations) will trigger the Photo Chooser UI to be displayed on the emulator too: private Action<IEnumerable<II... _callback; public void SelectFiles(Action<IEnum... callback) { var task = new PhotoChooserTask ......

How to work around a possible XNA Game Studio or Windows Phone SDK install failure on Windows 8

I am not sure if you guys know Aaron Stebner. Aaron works at Microsoft, and has pulled thorns from my side many many times already. His blog is at http://blogs.msdn.com/b/ast... and it is a gold mine of tips and tricks to debug and solve many cryptic issues happening during installation and removal of programs. For example, Aaron taught me how to remove programs that do not appear in the Programs and Features list, amongst many other things. The last nugget I used from Aaron’s blog saved my butt ......

Impressions, slides and code from TechDays Belgium and Netherlands

Update: Posted the video of “MVVM Applied” below. This week I was “on tour” in Belgium and Netherlands and presented 3 times: “MVVM Applied, From Silverlight to Windows Phone to Windows 8” (in Belgium and Netherlands) The goal of this session was to make people feel confident that the skills they acquired working in various XAML frameworks (Silverlight, Windows Phone, WPF, Surface, etc) are going to help them tremendously when developing Windows 8 applications. It was a session packed with code, ......

A fix for the design time error in MVVM Light V4.1

For those of you who installed V4.1 of MVVM Light and created a project for Windows Phone 8, you will have noticed an error showing up in the design surface (either in Visual Studio designer, or in Expression Blend). The error says: “Could not load type ‘System.ComponentModel.INot... from assembly ‘mscorlib.extensions’” with additional information about version numbers. The error is caused by an incompatibility between versions of System.Windows.Interactivity. Because this assembly ......

MVVM Light V4.1 with support for Windows Phone 8

Today is a very exciting day: After the official release of Windows 8 (and Microsoft Surface!) on Friday, and the official release of Windows Phone 8 on Monday, the Build conference is starting! This is the conference in which we will learn all about the developer experience for Windows 8 and Windows Phone 8. As a partner of Microsoft, I had the privilege of trying out some of the new things early, and this gave me the opportunity to port MVVM Light to Windows Phone 8 (it was already running for ......

#mvvmlight V4 update for Win8 RTM

With Windows 8 RTM out of the doors (at least for some of us), it was also time to create an update to MVVM Light. I selected the V4 RTM to do this (V4.0.23).This RTM version was released a few weeks ago with no much bells and whistles because I was just too busy to write much about it. Now after some vacation, I will resume blogging on all my favorite topics including of course MVVM Light. Upgrade Upgrading the installations should not require an ununistall, so try to simply run the MSI downloaded ......

Celebration! 120’000 downloads for #mvvmlight, 2 copies of Expression Studio to win

That is a symbolic milestone: Last week, MVVM Light reached the bar of 120’000 downloads on http://mvvmlight.codeplex.com, the site that has been hosting source and installers since the beginning of the project (100'000 downloads) and on Nuget, the popular package manager for .NET (20'000 downloads). More information about Nuget and MVVM Light. Scroll down to have a chance to win a copy of Expression Studio V4! MVVM Light started its “career” on Codeplex in October 2009. Back then it was intended ......

#mvvmlight V4RC available on #nuget

I just published the MVVM Light V4 RC packages to Nuget. Note that this is still technically a preview, so the main package is still V3. The V4 packages are available here: Package with libraries and content: When you install this package into a “virgin” application (i.e. an application without ViewModelLocator, preferably a brand new application), it installs a new ViewModel folder with a MainViewModel, ViewModelLocator and adds an entry into the App.xaml file to intialize a the ViewModelLocator ......

Declaring an ICommand in Windows 8 Consumer Preview

[Update 24/4/2012]

Well I'll be… after I posted this, a few people wrote to me and told me they are unable to repro the issue. I then tested again and indeed, it works. No idea why I couldn't get it to work in the first place.

More details here. Sorry about the confusion people!

Slides and source code for my past talks this year

I had the chance to be invited to talk at various conferences this year already, and I promised to post the slides and source code, so here it is! MVVM Applied: From Silverlight to Windows Phone to Windows 8 Belgium, Netherlands, Bulgaria The Model-View-View Model pattern is a common denominator between applications using XAML to create the user interface. First applied in WPF, it was then easily ported to Silverlight and Windows Phone development. With WinRT and the Metro-style applications, XAML ......

Screenshots of my #mvvm demo at #techdaysbe

Today I gave a talk in TechDays in Belgium about MVVM in Silverlight 5, Windows Phone 7 and Windows 8. This was the first time I gave that particular talk, and in addition keep in mind this is a developer preview, meaning that it is not finished, and not always stable. I had a few surprises with this build. For example from time to time, the new “Metro style applications” just cannot be launched anymore. Nothing that a simple reboot cannot fix… but I’ll come back to that in a moment. A couple of ......

Bug fix: WPF4 project template for #MVVMLight V3

Ironically, my last release of MVVM Light V3 was about fixing bugs in templates and making them better. In the process however, seems that I introduced a regression bug in the WPF4 project templates. Yep shit happens. How do I know if I have the bug? Check the Programs and Features control panel, and look for MVVM Light. If the “Version” column shows 3.0.2.19, you have the bug. If it shows anything higher, you don’t. For instance, the new version with the bug correction is 3.0.3.19. Also, any version ......

MVVM light V3 installer for non-English systems

After I released the MVVM Light installer, I got a note saying that parts of the installation failed on non-English systems (in that case a German installation of Expression Blend and Visual Studio). Specifically, what failed was the code snippets on Visual Studio, and the project and item templates in Expression Blend. After investigating, it is correct that these two particular features of MVVM Light were installed to language-coded folders. Correcting the issue for Expression Blend was easy enough ......

New MVVM Light templates with bug fixes

The current version of MVVM Light had a couple of issues in the project templates. The most annoying one was causing a problem when creating new projects: The GUIDs used to uniquely identify the project were in fact not re-generated properly every time, and we ended up with the same GUID in every new project. The symptoms are the following: If you side-load an MVVM Light application, and then side-load another one, you will see that the first one is overwritten. Note however that this is only an ......

Quick travel tip: charging USB devices from the Samsung Slate 7

For those of you who have the Samsung Slate 7 that Microsoft gave at Build (or that you purchase yourself!), and who are travelling: I hate to take chargers for all my gadgets, especially since my Windows Phone, my Bluetooth stereo headset and my Kindle (amongst others) all use micro-USB to charge. So I just take a couple of micro USB cables and I can charge my devices from the PC. However some laptops are cutting off power from the USB ports when they go to sleep. I thought it was the case with ......

MVVM Light installers and Nuget (including Silverlight 5) #mvvmlight

I just pushed two big updates to MVVM Light setup components. MSI installers with Silverlight 5 support The MSI installers are available on Codeplex. The current version supports Silverlight 3, Silverlight 4, Silverlight 5 (new), WPF 3.5 SP1, WPF 4, Windows Phone 7.0 and Windows Phone 7.1. The installer for V3 is available, as well as the one for V4 beta. NuGet support including Silverlight 5 I also pushed a new version of the NuGet packages which includes Silverlight 5. To install MVVM Light into ......

MVVM Light V4 beta1

This morning, I published MVVM Light V4 beta1 in the form of an MSI. The installation instructions are detailed on the MVVM Light installation page. Please make sure to uninstall previous versions before you install V4 beta1. There are quite a few changes in this version, and I plan to blog about various features in the coming days. As usual, stay tuned! Change log General changes Added XmlnsDefinitionAttribute for GalaSoft.MvvmLight.Command in Extras assembly. Setup Created an installer. Messenger ......

Proposing a new RelayCommand snippet for MVVM Light V4

In MVVM Light V4, I am proposing a new RelayCommand snippet, making it easier to declare and initialize a RelayCommand. I came up with a syntax that allows having the RelayCommand and its initialization in one convenient location. I am looking for feedback, so leave your comments below!! RelayCommand This is the code created by the code snippet after expansion, for a simple RelayCommand. private RelayCommand _testCommand; /// <summary> /// Gets the TestCommand. /// </summary> public RelayCommand ......

MVVM Light Toolkit patch for WP7 Mango Beta

On Tuesday the 24th of May 2011, the new version of the Windows Phone 7 SDK codenamed “Mango” was released to the public in beta. This is a huge iteration with an extremely large number of new APIs. Most exciting, the version of the Silverlight framework now used in Windows Phone 7 is Silverlight 4. Thanks to this, I was able to recompile the MVVM Light Toolkit for Windows Phone 7 based on the Silverlight 4 version. This is interesting because the Silverlight 3 version had a few hacks I had to build ......

“Mango” from the trenches part 2: Starting a Bing Maps navigation #wp7dev

At IdentityMine, we had the chance to develop a few applications featuring the new Windows Phone 7 features coming up in the update codenamed “Mango”. This series will showcase a few of the new features included in Mango that we used in those apps. Part 1: Adding a secondary live tile to the start page. Part 2: Starting a Bing Maps navigation Part 3: Updating a Live Tile locally (coming soon). Part 4: Adding your app to Bing Search Extras (coming soon). The feature Windows Phone 7 Mango features ......

“Mango” from the trenches part 1: Adding a new live tile to the start page #wp7dev

At IdentityMine, we had the chance to develop a few applications featuring the new Windows Phone 7 features coming up in the update codenamed “Mango”. This series will showcase a few of the new features included in Mango that we used in those apps. Part 1: Adding a new live tile to the start page. Part 2: Starting a Bing Maps navigation. Part 3: Updating a Live Tile locally (coming soon). Part 4: Adding your app to Bing Search Extras (coming soon). The feature One of the most recognizable features ......

Is your application powered by #mvvmlight?

A couple of days ago I had the wonderful surprise to find a mention (and a link!) to MVVM Light on USAToday.com. The article talks about the new USA Today app available for Windows Phone 7. MVVM Light is mentioned as well as JSON.NET just after the high quality of the development tools is mentioned: “That same high bar for tools extends into the community as well. MVVM Light and JSON.Net were extremely useful moving past mundane tasks and instead getting to the business of building our app.” – Tim ......

MVVM Light V3 on NuGet (now with WP7 support)

There was already a version of MVVM Light on Nuget before. However the old version did not support Windows Phone 7. This is now corrected. Also the new version now adds a ViewModelLocator to your project and includes it in App.xaml. What is NuGet? NuGet is a mechanism allowing to add packages (assemblies, source code…) to an existing project. All versions of MVVM Light are supported (WPF3.5, WPF4, Silverlight 3, Silverlight 4, Windows Phone 7). In order to install NuGet and learn more about this ......

My Swiss TechDays presentations sample code

I published the sample code from my presentations about Windows Phone 7 at TechDays Switzerland. I also published the Powerpoint slides on Slideshare (Windows Phone 7 Overview / Windows Phone 7 Deep Dive). One of the talks is available as a video on Channel 9. I expect the other one to be made available soon, stay tuned for an update. Windows Phone 7 Overview View more presentations from Laurent Bugnion Windows Phone 7 Deep Dive View more presentations from Laurent Bugnion Laurent Bugnion (GalaSoft) ......

MVVM Light V4 preview 3 (BL16, MIX11 edition!!) #mvvmlight

At MIX11, I am releasing a new preview of MVVM Light version 4. This new preview contains one small change and one large change. ObservableObject replaces NotifyPropertyChanged In the previous preview, I introduced a new class named NotifyPropertyChanged. However, I got a few suggestions to rename this class to ObservableObject, which is indeed a better name. In BL16, NotifyPropertyChanged was deleted and replaced by ObservableObject. Nothing else changes, just the name. ObservableObject is a very ......

Deep Dive MVVM samples #mix11 #deepdivemvvm

Here is the sample code I demoed in my MIX11 session “Deep Dive MVVM”. Please download the Zip file, and then unblock it in Windows Explorer by right-clicking it, and then selecting Properties. If you see an “Unblock” button, please click it. You can then extract the content of the Zip file on your hard drive. The slides are also available for download. Last year’s session To fully understand this session, an understanding of what MVVM is should be available. I recommend the following links: “Understanding ......

My MVVM talk’s material is online (#uktechdays)

Quick announcement: I just had the extreme pleasure to talk at the UK TechDays online conference (organized over LiveMeeting) and had about 100 persons in the session, thanks to all for allowing me to talk to you about MVVM! I just pushed the whole sample code as well as the slides to a SkyDrive folder, so feel free to download and experiment. And don’t forget: A recording of session with similar material but with 30 minutes more time for additional samples is online for your viewing pleasure. Deep ......

Building MVVM Light from Codeplex

I just published an article describing how to get the source code from Codeplex, build it, unit test it, get all the DLLs and install them to replace a previously installed version. It’s not very complicated, but it is good to have this information in one location. The article is available at http://www.galasoft.ch/mvvm... Happy coding! Laurent Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn ......

MVVM Light V4 preview 2 (BL0015) #mvvmlight

Over the past few weeks, I have worked hard on a few new features for MVVM Light V4. Here is a second early preview (consider this pre-alpha if you wish). The features are unit-tested, but I am now looking for feedback and there might be bugs! Bug correction: Messenger.CleanupList is now thread safe This was an annoying bug that is now corrected: In some circumstances, an exception could be thrown when the Messenger’s recipients list was cleaned up (i.e. the “dead” instances were removed). The method ......

MVVM Light V4 preview (BL0014) release notes

I just pushed to Codeplex an update to the MVVM Light source code. This is an early preview containing some of the features that I want to release later under the version 4. If you find these features useful for your project, please download the source code and build the assemblies. I will appreciate greatly any issue report. This version is labeled “V4.0.0.0/BL0014”. The “BL” string is an old habit that we used in my days at Siemens Building Technologies, called a “base level”. Somehow I like this ......

My proposals for the #MIX11 open call

Vote for: “Deep Dive MVVM” Vote for: “Exploring a Blendable Windows Phone 7 Application” Last year, the MIX team started a new concept with an open call for sessions. People from the community were invited to submit talks about pretty much anything, and the public voted to select which sessions they wanted to see. It was a huge success, since 150 sessions were submitted, of which 13 sessions were picked (don’t hold me accountable for the numbers, they are plucked from my memory ) I was very honored ......

#twitter for Windows Phone 7 protips (#wp7)

I started tweeting a list of “protips” (or whatever you want to call that) related to the Twitter for Windows Phone 7 application. Since I worked as integrator on this app, my tasks involved integrating design assets in all screens, and so I had an insider view on all the screens (and that is really a LOT of screens :) Seeing some comments about the app made me understand that most users out there don’t realize how rich the application is, and how many features are available. So without further ado, ......

Microsoft Shape

Today I have been invited by Microsoft Switzerland to present three of our awesome Windows Phone 7 applications on stage at their yearly Shape conference. It was a great moment, and I felt super proud to show the IMDb app, the Twitter app and the SBB Mobile app. The response was excellent, I didn’t have one single demo effect, was able to stream a movie preview live from the IMDb app, to show most features of the Twitter app, to load a timetable and purchase a ticket from the SBB app, and all this ......

Silverlight User Group of Switzerland (SLUGS)

Last Thursday, the Silverlight Firestarter event took place in Redmond, and was streamed live to a large audience worldwide (around 20’000 people). Approximately 30 if them were in Wallisellen near Zurich, in Microsoft Switzerland’s offices. This was not only a great occasion to learn more about the future of Silverlight and to see great demos, but also it was the very first meeting of the Silverlight User Group of Switzerland (SLUGS). Having 30 people for a first meeting was a great success, especially ......

Back from TechEd Europe 2010 (Berlin) #tee10

I spent this week in Berlin in company of about 5000+ other geeks at Microsoft’s TechEd Europe. I had experienced the conference for a very short time last year as I spent just 2 days helping on the Silverlight booth at the Technical Learning Center. This year however I was invited to give two talks and participate in a panel of experts. Taking Advantage of Microsoft Expression Blend to Build Silverlight 4 Applications: This session went pretty well even though it was at 6PM on Tuesday. The room ......

Adding a ViewModelLocator and Merged Dictionaries to App.xaml

I guess this is one of these places where using Blend is an advantage… since I do these operations mostly with the help of the tool, the XAML is generated and I don’t need to think about it too much. There is a trick when you add objects (for example Styles or a ViewModelLocator) to App.xaml when it already has merged resource dictionaries. The syntax is a bit convoluted, so here we go: <Application.Resources> <ResourceDictionary> <ResourceDictionary.Merg... <ResourceDictionary ......

MVVM Light Hotfix for Windows Phone 7 developer tools RTM

This is a hotfix to correct the issues with the MVVM Light templates for Windows Phone 7. Who is it for? Use this hotfix if (and only if): You have MVVM Light Toolkit V3 SP1 installed. You are using the new developer tools for Windows Phone 7 (RTM). Why a hotfix? The hotifx is needed because of changes in the Microsoft Windows Phone 7 assemblies (regrouping of classes in different namespaces and/or different assemblies) as well as some other changes (manifest structure, etc). The MVVM Light assemblies ......

How to use the MultiTouch Behavior for Windows Phone 7

Yesterday, I published the source code of the MultiTouch Behavior for Windows Phone 7 on Codeplex (http://multitouch.codeplex... Meanwhile, Davide Zordan (the founder of this project) started to modify the Silverlight 4 version of the behavior to make it API compatible. Eventually, the goal is to share all the API signature, and as much code as possible. We would like to extend this to the WPF version as well, in order to have a consistent landscape of multitouch on all 3 platforms. Together with ......

Windows Phone 7 multitouch behavior: beta testers needed (#wp7dev)!

I finished implementing version 0.1/beta1 of a multitouch behavior for Windows Phone 7 and need beta testers. What is the Windows Phone 7 multitouch behavior? Multitouch in Windows Phone 7 is not super hard, but there are a few things that need to be taken in account (such as the orientation of the device). In addition, it is very easy to get unwanted effects on a small screen (for example that the element becomes too big/too small). Also, in some cases the proportionality should be kept for a scaled ......

Two small issues with Windows Phone 7 ApplicationBar buttons (and workaround)

When you work with the ApplicationBar in Windows Phone 7, you notice very fast that it is not quite a component like the others. For example, the ApplicationBarIconButton element is not a dependency object, which causes issues because it is not possible to add attached properties to it. Here are two other issues I stumbled upon, and what workaround I used to make it work anyway. Code to demonstrate the issues and the workaround can be downloaded here! Finding a button by name returns null Since the ......

Be careful when installing the Blend Windows Phone 7 Add-In

There was a small issue today with the release of the Windows Phone Developer Tools CTP (April 2010 Refresh) refresh. The issue is that the Expression Blend Add-in Preview for Windows Phone (April Refresh) is not compatible with Blend 4.0.20408.0, which was the public RC (release candidate). A few days ago, the Blend team released a fix for an issue that was sometimes causing a crash when Blend was starting up. This new release (V4.0.20421.0) was not very well announced however, and many people (including ......

Crowdsourcing MVVM Light Toolkit support

Considering the number of emails that are sent to me asking for support for MVVM Light toolkit, I find myself unable to answer all of them in sufficient time to make me feel good. In consequence, I started to send the following message in response to support queries, either per email or on the MVVM Light Codeplex discussion page. Hi, I am doing my best to answer all the questions as fast as possible. I receive a lot of them, however, and cannot reply to everyone fast enough to make me happy. Due ......

Small change in MVVM Light Toolkit templates for Blend 4 RC

Ah, the joy of new releases… You will find that the MVVM Light Toolkit works fine with Visual Studio 2010 RTM and Blend 4 RC except for a few adjustments: Blend templates The path to the Expression Blend 4 project templates changed. If you start Expression Blend 4 RC now, you will likely not see the MVVM Light templates in the New Project dialog. New Project dialog with MVVM Light To restore the templates, follow the steps: Open Windows Explorer Navigate to C:\Users\[username]\Documen... ......

Using commands with ApplicationBarMenuItem and ApplicationBarButton in Windows Phone 7

Unfortunately, in the current version of the Windows Phone 7 Silverlight framework, it is not possible to attach any command on the ApplicationBarMenuItem and ApplicationBarButton controls. These two controls appear in the Application Bar, for example with the following markup: <phoneNavigation:PhoneAp... <shell:ApplicationBar x:Name="MainPageApplication... <shell:ApplicationBar.Me... <shell:ApplicationBarMen... Text="Add City" /> <shell:ApplicationBarMen... ......

MVVM Light Toolkit V3 SP1 for Windows Phone 7

He he I start to sound like Microsoft… Anyway… I just released a service pack (SP1) for MVVM Light Toolkit V3. Why? Well mostly because I worked a bit more with the Windows Phone 7 tools that were released at MIX0, and I noticed a few things that could be better in the Windows Phone 7 template. Also, I only found out at MIX that you can actually install custom project templates for Visual Studio Express. For some reason I thought it was not possible. The best way to solve these issues is through ......

Multithreading in Windows Phone 7 emulator: A bug

Multithreading is supported in Windows Phone 7 Silverlight applications, however the emulator has a bug (which I discovered and was confirmed to me by the dev lead of the emulator team): If you attempt to start a background thread in the MainPage constructor, the thread never starts. The reason is a problem with the emulator UI thread which doesn’t leave any time to the background thread to start. Thankfully there is a workaround (see code below). Also, the bug should be corrected in a future release, ......