DarksideCookie

Come to the dark side...we have cookies!

Sample code from my LEAP presentation about cross-framework code sharing

Yesterday I was invited to speak in front of a bunch of really sharp guys attending the Lead Enterprise Architecture Program, LEAP, at Microsoft here in Stockholm. The topic of the day was how to share code between projects targeting multiple frameworks/platforms. Basically “how can we share code between projects aimed at WP7, Windows 8, Silverlight and WPF” in a useful way, limiting the duplication of code as well as maintenance.

Most of my presentation revolved around a sample I had written to target all platforms. It is a very simple application, but still shows that it is very possible to get it to work.

More...

Posted: May 04 2012, 09:11 by ZeroKoll | Comments (2) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

Developer/Designer Workflow According To Me - Take 1

A question I keep running into when I speak about XAML-based application developer is how the developer/designer workflow should work. I don’t know if the question is common in general, or if it is because people feel that I’m not only passionate about coding, but also about design.

I have spent quite a lot of time thinking about how this workflow should work when working with XAML. In other technologies, I believe that the flow is much harder to get going, and I believe it requires more steps. In the “XAML world”, it should be a lot easier. The separation between functionality and design is pretty clear. And this separation should enable quite a well working flow.

Before I get into how I see it, I want to add a disclaimer… I have not been able to try this out in the real world as much as I would have liked. Mainly because I, in most cases, play all the roles. Or at least manage everything from XAML to code, with visuals coming from a designer.

More...

Posted: Nov 16 2011, 14:54 by ZeroKoll | Comments (2) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Design | Personal | Silverlight | WPF | XAML
Manage post: :)

Xml namespaces for custom control libraries

Ok, it has been a while since I posted now, but there has been a too much going on, and I guess I should be blogging about Silverlight 5, as it is on the agenda for MIX. I have even had the possibility to early access to the Silverlight 5 bits, but I have had too much to do to come up with some good posts about it. That is not to say that there isn’t a huge amount of really good stuff in the next release! But besides not having had time to play with it, I am not allowed to blog about it until it is actually available…

But, in the mean time, I thought I would do a quick post about a little feature that I am not seeing a lot of people using. It is nothing ground breaking, or even very necessary, but still helpful. I am talking about the ability to declare custom Xml namspaces to your assemblies…

More...

Posted: Apr 13 2011, 10:57 by ZeroKoll | Comments (1) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

Code from my presentation at the NZALM conference

Earlier this week, I had the pleasure of presenting at the NZALM conference here in Wellington. Even though it was an ALM/Visual Studio conference, there was a “lot” of MVVM talk.

I did one intro session called “MVVM – The Naked Truth” and one deeper one called “MVVM – Going Beyond Hello World”. Both sessions went well according to me, but on the other hand I might be a bit biased… Hopefully the attending people would agree with me, but you never know.

As part of the talks, I did both write and show some pre-written code that I promised to put up here on my blog. So here it is:

MVVM - The Naked Truth.zip (18.88 kb)

MVVM - Going Beyond Hello World.zip (333.08 kb)

I also mentioned another blog post that would contain even more code samples. And since the search functionality on my blog for some reason is broken (I think it has to do with a new engine version with old theme…), I thought I would link to it from here instead. So here it is: http://chris.59north.com/post/SLAMD-session-code.aspx

If you have any questions about the code, just give me a yell or drop a comment and I will help out as much as I can!

Posted: Apr 08 2011, 12:12 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight | Speaking | WPF
Manage post: :)

Multithreading my way

Ok, so Silverlight is a very cool technology, and Microsoft has done a whole lot of things to make sure that it performs the way it should. They have done things like forcing you to run long running tasks, such as webservice calls, in an asynchronous fashion. But if you start doing long running tasks on your own, you need to make sure to handle the multithreading yourself. Why? Well, if you don’t, you will perform all of that stuff on the UI thread.

And why is performing heavy things on the UI thread a bad thing? Well…it just is!

More...

Posted: Feb 21 2011, 01:05 by ZeroKoll | Comments (4) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

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...

Posted: Feb 07 2011, 08:44 by ZeroKoll | Comments (0) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

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...

Posted: Dec 04 2010, 03:07 by ZeroKoll | Comments (8) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

Finding and mitigating memory leaks in managed code using ANTS

A week or so ago, I got a call from a client who had some issues with an application that I had built. The application is a WPF 4 “media player” that is supposed to runs 24/7. The issue they were facing was that it only ran for about 12 hours before crashing. And at startup it used less than 100Mb of memory, and at the end (before crashing) it used about 1500Mb. So it clearly had a memory leak. And I needed to find it…fast!

And since this is the first time I have had to do this, I decided to share my experiences. Hopefully it will help someone…

More...

Posted: Nov 16 2010, 09:17 by ZeroKoll | Comments (2) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .NET development | WPF
Manage post: :)

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...

Posted: Oct 18 2010, 07:34 by ZeroKoll | Comments (4) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Manage post: :)

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...

Posted: Oct 05 2010, 04:59 by ZeroKoll | Comments (4) |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Silverlight | WPF
Manage post: :)