General background: We are using CSLA4/ Silverlight4
I watched the MVVM video you posted on your blog. Thanks for that! It was very helpful. However, I am slightly confused now, having listened to it and also perused your ‘CslaMVVMSl’ project.
You talk about the ‘Viewfactory’ and ‘Shell’ concepts in the video and I am assuming the framework you are using to support that is Bxf . I looked at how it is being used in the sample project and it seems like the underlying assumption here is that the View:ViewModel relationship is 1:1 type. The “ShowView” functionality uses the xaml, viewmodel key, viewmodel instance as parameters. So, I am thinking that there can be only 1 viewmodel use in a view. Is this correct or am I way off?
In our project, there have been numerous instances where a single page/usercontrol has multiple viewmodel instances. Do you think that we need to separate these and decouple them so there is a 1:1 relationship?
For those who don't read my blog: http://www.lhotka.net/weblog/CSLA4AndMVVMVideoSeries.aspx
I typically have a view bind to one "root" viewmodel. But there may be other viewmodel objects for sub-areas of a view.
How that works depends on the view itself. If the "view" is really a set of different regions that are independent, I'll usually still have a "viewmodel" or "presenter" to which the view binds, with specific viewmodels for each different region.
But more common is the case where the view binds to a "root" viewmodel, and sub-areas or controls of the view bind to "child" viewmodel objects.
The demo parts of the video series will demonstrate those concepts and implementation.
I posted an issue I am having with the current build of the CslaMVVMSl sample (from SVN) and it is in regards to your comment above:
"But more common is the case where the view binds to a "root" viewmodel, and sub-areas or controls of the view bind to "child" viewmodel objects."
Please see the post http://forums.lhotka.net/forums/p/9052/43026.aspx#43026 which further explains an issue I am seeing with edit level.
I have decided to put Bxf (Basic XAML Framework) online through CodePlex: http://bxf.codeplex.com
I'll probably remove the Bxf code from the samples where I've been using it, and instead have those samples use releases from the CodePlex site. I think this was a necessary step to avoid having many different versions of the code scattered all over the place.
And of course having this as a CodePlex project means it is relatively easy for other interested people to join into any development effort on Bxf itself.
Copyright (c) Marimer LLC