Removing Design Time references at compile time

As you might have noticed on my blog, I like working with Silverlight, and I like using the MVVM pattern when I do so. As a part of this, I generally create design time ViewModels to get the best help from the tools (VS and Blend). VMs

The annoying thing about this, is that project containing the design time information need to be referenced by the application for the whole thing to work. But when the app is built and released, I really don’t want the extra ViewModels to be included in the xap file. I guess, in most cases, they are fairly simple and small, making the xap bloat minimal. But it still feels wrong. And it feels even worse when your design time VMs become large due to embedded resources such as images and data…

More...

Sessions for MIX11

Earlier today I got word that some of my sessions, that I had sent in as a part of the Open Call for MIX11, had gone past the initial round and are on the MIX11 website for voting. And the sessions that get the most votes gets to be presented at MIX11.

So this obviously means that I need a LOT of votes. And that means that I need you to vote on any of my sessions  that you find interesting. Or all of them if you just want to help me to get the possibility to present at MIX11…

The sessions are available here: http://live.visitmix.com/OpenCall/.

And what are my sessions? Well, I am glad you asked. They are…

Silverlight and Windows Azure - Tips from the Trenches
Join Chris Klug as he share his expertise in combining Windows Azure and Silverlight. This session will provide practical insights on using Silverlight with Windows Azure. It will include guidance on using Silverlight applications with Azure Web and Worker roles as well as approaches for using Windows Azure storage directly from your Silverlight app. This session will also cover the use of Windows Azure as a delivery mechanism for Windows Phone 7 push notifications and as a delivery mechanism for streaming media. Vote

From Phone Zero to Phone Hero in 60 minutes
Join Chris Klug & Chris Auld from Intergen as they build a real Windows Phone 7 app from scratch in 60 minutes. This is a hard core, dual data projector, coding marathon. Chris and Chris will build a Windows Phone 7 series application including Windows Azure hosted push notifications, a rich Silverlight UI and partner integration. You'll see how to take an idea from concept to the Windows Phone Marketplace in just an hour. In other words, not your general 'Hello World' application. Vote

MVVM - The Naked Truth
Model-View-ViewModel is the pattern of choice when writing Silverlight, WPF and Windows Phone 7 applications. It offers the developer a structured way to implement UI functionality and logic. It especially well with the mentioned technologies, as it uses built in features to enable a clean separation between form and function. During this session you will join Chris Klug, a Silverlight Solution Specialist from New Zealand, as he tells all about how you get started with MVVM. The goal is to get an understanding of why it is useful and how it can make your life simpler. And it will be presented in a naked form, no frameworks or helpers, enabling you to focus on the basic ins and outs of the pattern. Vote

Building Composite Silverlight Applications
Silverlight is a great platform for rich internet applications, but a lot of developers seem to forget that we can use many of our advanced desktop app approaches too. By adding a plug-in architecture we can make our apps easily extensible for future requirements. This session provides an introduction to plug-in approaches in Silverlight. It explores both PRISM and MEF as tools for implementing this pattern. You'll leave with the practical knowledge you need to add a plugin mechanism to your new and existing applications. Vote

The Phone Zero to Phone Hero will probably not be presented together with Christ Auld though as he probably won’t be able to go to MIX this year. But I will try and find a worthy replacement if that session were to get picked. And I really hope it is, cause it is a very entertaining session that is very far from your normal session. And also because it seems to polarize the crowd a lot. We have got feedback that ranges from more or less “the worst session ever attended” to “the best session ever attended”. Luckily, the good feedback seems to come from people who go to a lot of conferences and have a bit of experience, which is sort of required to grasp the information at the speed that it is presented…

That’s it for now. More coming soon… I hope… I have a little too much to do at the moment…

My view on HTML 5…and Silverlight

I continuously get questions regarding HTML5 and Silverlight. Especially after Microsoft’s somewhat brilliant comments at PDC. How is Silverlight going to survive now that HTML5 is coming? Why would you chose Silverlight over HTML5? Are you going to lose your job now that Silverlight is dying?

Well, I have finally decided to state my opinion  on my blog. It is obviously a biased opinion as I believe Silverlight to be a better choice in a lot of situations. So this is obviously a risky engagement, but I guess I will just have to endure the flaming I am going to get from a lot of people. Even a lot of people close to me.

But before I go too far, I do want to mention that we are living/working in an ever changing world. My opinions regarding the different technologies will probably change over time as the world changes. But this is my current view of the situation…

So…here we go…let the rant begin!

More...

MVVM and animation, revisited

A while back, quite a while back to be honest, I wrote a blog post about using animations in the MVVM pattern. And even if the way of doing it mentioned in the post still works, I would not recommend using it.

Adding the animation support in the way that that blog post says, will couple your VM to the StoryboardManager. Not that this really matters, as it will still be quite testable and so on. But it feels wrong…and I don’t like things that feel wrong…

In this post, I aim to cover a couple of ways that we can trigger animations and state changes based on the VM. And yes, these techniques have been hashed and rehashed on several other blogs, and you might already have read about it, but I still have people come to my blog to read the old post. So apparently it is still an issue for some…

More...

Referencing class library projects with references from Silverlight application projects

One “feature” in VS2010 (and 2008 I assume) that bugs the hell out of me, is the way that referenced assemblies are packaged in Silverlight projects… And please let me know if you know of any fix for this!

Imagine that you have a solution with at least 2 projects. One Silverlight application project, and one class library project. The app project references the class library project as it contains functionality it needs. The class library project in turn references another assembly (or maybe more than one) that is needed for it to be able to run. This (or these) other assemblies are not default Silverlight assemblies, so they will not be on the target machine and needs to be included in the deployment… Unfortunately, this is where VS screws up…

More...

Sharing resources and styles between projects in Silverlight

I have lately been working on a somewhat larger Silverlight application for a client here in New Zealand. The application is being built using PRISM, which means that it is loaded in a composite/ modular way. And with this modular/composite loading, being able to share resources between different modules becomes pretty interesting as it makes it easier to get all modules to share the same look and feel. So this got me to rehash a topic I have already talked about before, merged dictionaries.

This is obviously not a PRISM only thing to do, but it often becomes a little more sought after when the application starts getting spread out over several different projects… Luckily, it is very easy to share resources between projects in Silverlight.

More...

Data binding images with MVVM

The title for this post make it sound like the world’s simplest thing. And to be honest, it sort of is. It is not hard to get images from the ViewModels into the view, but there are several ways of doing it. Each with its own pros and cons.

In my world, my VMs often get urls/uris to images instead of the actual image. The reason for this I guess is sort of the same thing as why you shouldn’t store your images in the database. The models can become huge if they include the images, especially if we add a couple different image sizes and so on. And that is without considering the possibility of us transferring a whole array of these objects across the wire. And in a lot of cases we don’t even show all the images in the UI, so why would we pass the images along if we don’t need them…

More...

Another user group meeting

Next Wednesday, October 20th, I will be presenting at the .NET user group here in Wellington again. This time the talk is all about smooth streaming (same talk as I presented at TechEd NZ). It covers everything from encoding your media, to publishing it on your server and of course also how to consume it from Silverlight. It will also be covering how to get your first live smooth streaming event going.

The talk does, as you can see, cover a wide array of things that has to do with smooth streaming. And to make it even broader, I will show off the Rough Cut Editor (an open source rough video editing tool built in Silverlight). And it would of course not be complete with out touching the cloud. So to finish it off, I will show you how you can deliver smooth streaming media out of Azure blob storage. A very cost effective and good way to share your media.

So if you are in Wellington, or close by, feel free to drop by if it sounds interesting. More information is available here: http://www.dot.net.nz/UserGroupPages/WellingtonNET.aspx

Audio recording and encoding in Silverlight

A while back, a client asked my company if we could help them with a feature for a web application they were using. They needed to make audio recordings online. Basically the application shows off users portfolios online, and offers the ability to add comments about their work.

So far, all comments and graces have been made using text. But now they wanted to move it into a somewhat more interactive solution, making it possible to record audio comments and thoughts about the users portfolio.

And obviously, being a Microsoft focused company, we came to the conclusion that this would be an easy thing to do in Silverlight. Especially since we all know that Silverlight in later releases gives us access to the users microphone and webcam. So this would be a piece of cake…or would it…?

More...

MVVM and “restricted” functionality

So, I am back with a new post after WAY too long. It got really busy around TechEd Aus and NZ, and I really thought and hoped that I could get back and become active again as soon as that was over. Unfortunately, pushing work in front of you doesn’t really clear it…so when I finally got back from Auckland, I had a whole pile of things to do…

Anyhow…enough with the excuses…get to the topic already! So the topic is how to handle commanding with “restricted” functionality. There is two things in that sentence that I want to clarify. With commanding, I mean move functionality from the view into the viewmodel and removing as much code as possible from the code behind of the view. And with “restricted” functionality, I mean the type of functionality that cannot be handled anywhere but in the code behind of the view…

More...