views:

54

answers:

1

Back in January 2009, Dino Esposito published an article on MSDN titled "Managing Dynamic Content Delivery In Silverlight". We are considering using an approach like this for an upcoming project and were wondering if anyone had any advice on whether this is a good approach. Are there any traps or pitfalls we should look out for? We currently use Prism and would need to look at how the two would live happily together.

A: 

Yes! This approach, in my opinion, is what makes Silverlight and WPF so incredibly powerful. I have done this in the past and it is AMAZING how well it works. Data binding and ViewModels make it especially easy to do. Even better is if you use the dynamic capabilities of C# 4.0 to push dynamic properties into your ViewModel that your View can bind to. In other words, you can push down dynamic values that your dynamic views can bind to.

When you get it all working, it is beautiful.

A bit of self promotion here, but my ViewModel base class has a lot of support for this type of dynamic data binding approach.

As far as doing this with Prism, you can take advantage of the modularity Prism that prisim was built with. You can override the RegionRegistry, for example, with one of your own that knows how to create the dynamic view given the region name.

Beautiful, Beautiful stuff here.

Brian Genisio