Latest Tweet:
  • Loading...

I know. It’s been too long since my last post, and just to clarify; I’m not dead, nor have I been eaten by sharks or anything like that. I’ve just been busy rebooting my life back in Trondheim after coming back from Australia. I started working again in Trondheim in the beginning on January and went straight back on to a Windows Forms/WPF project I helped start up back in September 2007. It has been really fun to see how the code base has evolved over the year I’ve been gone. After getting back on the project I’ve spent most my time developing WPF components inside the Windows Forms client. It’s been an interesting experience, and I’m really happy with how well WPF integrates with existing Windows Forms applications. I will definitely be blogging about some of my experiences around WPF and Windows Forms in the weeks to come.

However, the main reason for the slowdown in posts is not work related. Hege and I just bought an apartment, and ever since we moved in all available time have gone to painting walls, shopping for furniture and all kinds of other things you need to get in order when moving into a new place. We are really happy with the apartment, and things are really starting to shape up. We finished painting the last room this weekend. I will be posting a “tour of the geek crib” once all the tech stuff (fun stuff) is in place.

Okay – enough excuses for not blogging. The more topic of this blog post is that I’m doing a series of talks on Silverlight 2 during the MSDN Live tour. First stop of the tour is Stavanger (05. March), before moving on to Bergen (10. March), Trondheim (12. March) and finally Oslo (19. March). I will be giving two sessions, one on developing data centric/business focused Silverlight 2 applications (similar to my Tech Ed Talk), and one on Silverlight 2 tips and tricks. The tips and tricks session will be 5-6 covering things like printing, deep linking, search engine optimization, design time support, continuous integration etc.

I’ve included the session abstract (in Norwegian):

msdnliveForretningsapplikasjoner i Silverlight 2
Silverlight 2 ble lansert nå i høst og legger et godt grunnlag for utviklere som ønsker å lage rike internett applikasjoner (RIA) basert på .NET. I denne sesjonen går vi i dypden på Silverlight 2 som utviklingsplattform og fordelene ved å velge Silverlight 2 som plattform for data-sentriske forretningsapplikasjoner. Sesjonen vil blandt annet dekke dataaksess via sikrede WCF tjenester, hvordan strukturere koden ved hjelp av Model-View-ViewModel patternet (MVVM), hvordan skrive kode designere kan jobbe med, og enkle Blend-tips for utviklere. Sesjonen vil bygges rundt en dykkeloggapplikasjon hvor koden vil bli gjort tilgjengelig etter presentasjonen.

Tips og triks for Silverlight 2-utviklere
denne andre sesjonen vil vi bygge videre på dykkeloggen og fokusere på en del konkrete tips og triks for Silverlight 2-utviklere. Tett integrasjon med nettleseren er viktig for en best mulig brukeropplevelse. Vi vil blant annet se på hvordan integrere med fram/tilbake knappene i nettleseren, hvordan optimalisere Silverlight applikasjoner for søkemotorer, hvordan bruke dyplenking i Silverlight og hvordan håndtere utskrift fra Silverlight. Presentasjonen vil gå i dybden på blant annet HTML-bridgen som brukes for å integrere Silverlight med JavaScript som allerede kjører på siden, eller for å aksessere nettleserens DOM.

One of the sad things about this round of MSDN Live is that Microsoft have to charge for it. Previously MSDN Live have been a free (and really popular) event, but Microsoft is feeling the financial crisis just like everyone else. So in order to be able to deliver MSDN Live this time they had to charge for it. Børge Hansen from Microsoft Norway and Jon Torresdal from NNUG Bergen have shared their thoughts on this decision. I was really bummed about this decision myself, but I really hope that you find the content presented at MSDN Live interesting, and that you get a chance to attend.

Since this post is about upcoming speaking engagement I figure I could finish the post by sharing a time lapse video of a Silverlight 2 presentation I did last week at the local university. The time lapse is created by Pete J Samuel, a colleague of mine at Capgemini Trondheim.

Hope to see you at MSDN Live in Stavanger, Bergen, Trondheim or Oslo!

Sunday, February 22, 2009 11:37:17 PM (W. Europe Standard Time, UTC+01:00)
This will be interesting, looking forward to see you in Bergen.

-Mark
Monday, February 23, 2009 4:01:05 AM (W. Europe Standard Time, UTC+01:00)
Hey, Congrats on the apartment...welcome to the world of home ownership and the biggest consumer of time and money I have found so far :) It's worth it though
Monday, February 23, 2009 8:18:59 AM (W. Europe Standard Time, UTC+01:00)
I keep hearing Good Things about your talks :) Looking forward to seeing you in Stavanger
Tuesday, February 24, 2009 3:08:51 PM (W. Europe Standard Time, UTC+01:00)
@Mark & @Glenn: Thanks for the comment. Meeting fellow .NET developers around the country is the best part of MSDN Live. I'll try to make it to GeekBeer in both Bergen and Stavanger!

@Bronwen: Thanks, and yeah - so far it have definitely consumed allot of time and monney ;) But it will be so nice to finally have something to call our own.

To bad I'm missing out on MVP Summit this year - would have been great to be able to catch up with Aussie friends. Catch you on Twitter :)
Tuesday, March 03, 2009 4:14:33 PM (W. Europe Standard Time, UTC+01:00)
Glad you liked the vid :)
Tuesday, March 10, 2009 4:05:50 PM (W. Europe Standard Time, UTC+01:00)
Hi Jonas, glad to hear you're not dead. :-)

I had a question about the DiveLog Silverlight application that I was hoping you could shed some light on. I'm not sure if this is the best way to get it to you, but since this is your most recent post I thought I'd try leaving a comment here.

The question is about the Commanding implementation. I've been using the MVVM pattern and the Commanding implementation from your DiveLog sample (thanks again - it's a great sample and I love using the pattern). The problem I've run into is in regards to unregistering the event handlers for the command executed events when the view is unloaded. My app currently has two main views that the user can switch between. What I've found is that when View1 is first created, the command executed handlers get wired up and run fine. But if the user switches to View2 and then switches back to View1, the handlers get wired up again and end up running twice. If they switch back and forth again they'll run three times, etc.

You can see this behavior in the DiveLog demo too by adding a second page and implementing a simple page switching behavior, something like Jesse Liberty does here: http://silverlight.net/blogs/jesseliberty/archive/2008/05/31/multi-page-applications-in-silverlight.aspx.

Do you have any recommendations about how to avoid that? I haven't been able to figure out a good way to unregister those handlers when switching to another page. I have tried out the commands available from Microsoft's Prism project, and that seems to be a good alternative, but I was wondering if there was a simple solution using your command implementation or if you would recommend the Prism approach.

Thank You,
Kevin Kuebler
Kevin
Friday, March 20, 2009 12:15:39 PM (W. Europe Standard Time, UTC+01:00)
Hi Kevin,

And thanks for the comment. I think you've actually found a bug in my code. The problem is that the Command objects are set as static properties on my Commands class which holds a reference to all the commands in the application. Since you don't de-register the event handler when the view unloads (switching to page two) the ViewModel object does not get disposed. When you go back to the page and create a new instance of Page 1, you get a second ViewModel instance, which listens to the same event. So it appears that the event is fiering twice, but I think it's actually two different ViewModel instances (do a GetHashCode using the debugger to verify this).

So my suggestion:

1) Add an event or something to notify the ViewModel when it's unloaded. That way you can remove the event handler, and the ViewModel object will get disposed correctly.

2) I would recommend the Prism approach - and have actually switched to Prism commands in my current implementation. The benefit is that you can use data binding to bind against Command properties on the ViewModel. This enables you differentiate between local and global commands. Local commands goes in the ViewModel as properties, Global commands goes in a seperate class added as an application level resource. That way commands like "SaveDives", which might only be relevant to View1, is only available to View1.

Cheers,
Jonas
Friday, March 20, 2009 12:16:02 PM (W. Europe Standard Time, UTC+01:00)
Hi Kevin,

And thanks for the comment. I think you've actually found a bug in my code. The problem is that the Command objects are set as static properties on my Commands class which holds a reference to all the commands in the application. Since you don't de-register the event handler when the view unloads (switching to page two) the ViewModel object does not get disposed. When you go back to the page and create a new instance of Page 1, you get a second ViewModel instance, which listens to the same event. So it appears that the event is fiering twice, but I think it's actually two different ViewModel instances (do a GetHashCode using the debugger to verify this).

So my suggestion:

1) Add an event or something to notify the ViewModel when it's unloaded. That way you can remove the event handler, and the ViewModel object will get disposed correctly.

2) I would recommend the Prism approach - and have actually switched to Prism commands in my current implementation. The benefit is that you can use data binding to bind against Command properties on the ViewModel. This enables you differentiate between local and global commands. Local commands goes in the ViewModel as properties, Global commands goes in a seperate class added as an application level resource. That way commands like "SaveDives", which might only be relevant to View1, is only available to View1.

Cheers,
Jonas
Thursday, November 12, 2009 8:18:32 AM (W. Europe Standard Time, UTC+01:00)
Java is the most distressing thing to happen to computing since MS-DOS !
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
<August 2010>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234