MVVM and animations…

Right now I am working on a Silverlight project for my company. In that project, as in most projects with Silverlight I need to run some animations. And since I’m working with MVVM this becomes a little cumbersome and complicated. I don’t want my view to be dependent on the viewmodel. So the view cant tell the model what storyboards to play. And I don’t want the viewmodel to be dependent on the view either. So i don’t want to give the viewmodel a referens to the view. I guess I could get some separation using interfaces, but it still felt a little off… So I thought a little about this, and then I Googled it. Do you know what I found when googling for “patterns mvvm animations”. Nothing really useful. A bunch of questions. I even tried to search for WPF and tried to leverage the WPF delelopers knowledge…no luck… So I had to figure something our myself. And I think I have actually found a pretty nice separation by using a Storyboard manager object.

More...

flickrVIEWR – A flickr viewer in Silverlight – Part 2

Hello again! It is time to go through the next phase in the development of the flickrVIEWR that I started a couple of days ago. The viewmodels. As usual I do build my Silverlight application using the MVVM pattern. I like this pattern a lot. Coming from an ASP.NET background, I think it offers a lot of nice features that I whish where available in general web development. I guess you do get some of the benefits and features by using MVC, but I have yet to try out doing that. And I will, I promise.

Anyhow…the viewmodels for the flickrVIEWR is not that complicated. Not at all. THhey have some small tricks up their sleeves, but nothing really cool. But before we get to the viewmodels I’m going to take a small detour via a service locator…

More...

flickrVIEWR – A flickr viewer in Silverlight – Part 1

I’m back! I’ve had my work up to my eyeballs the last couple of weeks. Apparently moving to the other side of the world and starting a new job takes a lot of time. So after that excuse, it is time to get started with my new project.

My fiancée has this blog where she blogs about our new life in NZ. And this is interesting to you because…? Well, it isn’t, but it is the reason for this blog post as well as a few more coming soon. On her blog, she posts pictures. These pictures are taken by her or me by a camera with several megapixels. That makes them too big for her blog. So she has to resize them before uploading them. This takes time and is annoying. So I offered to solve it in a somewhat more modern way. By using flickr. So she will upload her images to flickr and then use a little Silverlight application to show them on her blog. So that’s where this blog post is about…the flickrVIEWR…

More...

New Zealand and Intergen it is

I just wanted to explain why my blog has been completely quiet for a pretty long time until tonight. Me and my other half har just migrated from Stockholm (Sweden) to Wellington (New Zealand). I’ve started working at Intergen as a developer, which means that I get to be in the real world instead of just teaching like I have for the lest 2 years. So the move has taken up a lot of my time, and then when I got here, it  took about a month to get an apartment and the internet connection. So…that’s the reason…

More...

The CommandManager…again…

A little while ago I got a question on my blog about how to attach multiple commands to a control. That was something that is so obvious and so obviously not supported in the first version of the command manager. So I quickly wrote a message back saying that I would build that and it would be up on the blog soon. Well…I ran into some trouble…so it took a little longer than expected. And the solution might not be the best, but it works. So here it is…the CommandManager 2.0.

More...

Designer – Developer workflow…?

At my talk at TechDays 09 here in Sweden, I was followed on stage by two guys from RTC Factory. They were there to talk about the workflow between the developer and designer. One of the big upsides to Xaml and Silverlight/WPF is that we can split the design and coding between the developer and the designer. No more mock-ups from the designer that the developer needs to implement. In the world of Xaml, the developer creates the functionality and the designer the design. Like it should be. We are all specialized within our area, which is natural. And hence it is also natural to split the responsibilities. So how does this work?

More...

TechDays ‘09 – Poor performance Chris (let’s blame the world)

I’m on the train on my way home from speaking at the TechDays conference in Västerås, Sweden. Unfortunately my talk about Xaml turned into a spiraling tornado of crap. And you can quote me on that. I guess that trying to prepare a talk at a developer conference at the same time as you are working fulltime, packing up your life for a move around the world as well as trying to focus on a whole different tech area (Prism 2) is not a good solution. It turned out to be a pretty mediocre or even sucky presentation lacking structure. So for all of you who attended by talk, I’m really sorry! I know I shouldn’t come up with excuses, I blew it. But that’s the way it goes sometime…

More...

Creating a command manager in Silverlight 2

After having worked a bit with the Mode View ViewModel pattern in Silverlight, I've sort fallen into a trance chanting "MVVM, MVVM, MVVM". It gives the developer such a good platform to work with. The MVVM pattern is a modified version of the MVC and MVP patterns. By now, you are probablyabout to closer your browser due to the pattern rant I'm on. Well, don't. This isn't about MVVM really, only a little. The MVVM pattern was "created" by John Gossman at Microsoft, specifically to target WPF. This also means that it works great in Silverlight. But Silverlight is smaller, and missing some features... The CommandManager is one of them. This post shows a way to handle this shortcoming.

More...

Creating custom controls in Silverlight - part 2

In part one, a button like control was created. It worked like a button, or at least a little. It was a square with a descriptive text and a brand new Click event. Unfortunately that doesn't really make it feel like a button. There is more to a button, especially in Silverlight and WPF. First off, a button normally gives some visual feedback to the user, confirming that it is pressed or that the button is hovering over it. That visual feedback is something that you find in most button implementation, whether it is in Windows Forms, HTML or WPF. The thing that is special with buttons in WPF and Silverlight is that the content of the button - in this case the descriptive text - can be anything. And I mean ANYTHING. It could be a Grid with several controls inside. Not that I would recommend doing some of the things that you CAN do, but it is possible. So in this part of the tutorial, the button will get visual feedback and support for complex content.

More...

Creating custom controls in Silverlight - part 1

After having written mhy previous entry about how to style and template controls, I guess it is a good time to have a look at how to create controls that are template- and styleable. (Can you write "template- and styleable"? Looks weird...well...I am swedish so I'm allowed to write less than perfect english) Unfortunately, due to my lack of imagination, I don't have a really cool control to build and show you. So instead I'm going to create a very limited control that will work more or less as a simple button.

More...