LOB App with Silverlight, WCF RIA, MVVM and EF 4?
I develop in WPF with EF (EDM designer entities).
I now want to move to Silverlight+RIA, and I am looking for a turorial, video or whatever that will guide me how-to to use Silverlight RIA with MVVM using EF as the model.
I have extensive knowledge of: .NET 4, WPF, XAML, DPs, DataTempaltes, EF 4. I am familiar with Silverlight, WCF RIA and MVVM.
There are two things about LOB+MVVM I am encountering difficulties:
I am looking for a way to template my work, so I don't have to copy-paste the content of my
ViewModel
s, what I mean by that is having a genericViewModelBase
that will handle a certain type ofModel
(s):ViewModelBase where TContext : DomainContext, TModel : Entity`
Another difficulty is the overall composition of the UI; say I have a branch of master detail that gets complicated more and more all in one screen. I want all the parts to be divided into tiny
View
s each for its point. The problem is, I don't know how to expose the data for the inner views, say the main view'sDataContext
is set withMainViewModel
, and there is a propertyContact
in theMainViewModel
; how would you set the Contact view inside the MainView, setting the inner view (the ContactView)'s DataContext to ContactViewModel AND setting the ContactViewModel's Contact to the current C开发者_Go百科ontact from the MainViewModel, what is the right technique??
NOTE: I am self-employeed, no teams and not other developers, so I don't see a reason splitting everything into modules, I don't mind if the whole project will reside in one project split into folders etc.
I always find Mike Taulty's blogs useful for this sort of thing.
So try this followed by this.
And on the MVVM side of things I use the MVVM Light Toolkit, also try watching this very good video by Jason Dolinger
精彩评论