I am starting to write an application in Silverlight with RIA services and SilverlightFx.
Now this application is a pretty big one has has lot of interaction between controls.
As an estimate it will have around 60-70 user controls. Now my questions are..
-
Is it good to choose .Net Ria and SilverlightFx? (My view is..It is not going to production very soon. And as it is a big one using frameworks will help unit testing and save development time once the frameworks are understood properly.)
-
After reading through the blogs I am not really clear how SilverlightFx handles interaction between user controls. For example I have a user control (say "S") that have the search functionality…auto complete and all…Now I have another UserControl (Say "R") that displays the search results. The display result panel can be used from search user control or another user control (Say F) that gives all items of a particular category. I can not marge Search and Select Category into a single userontrol. So how to do it?
If I create different ViewModels how they will interect with each other? -
Is it better to create Domain service context in each ViewModel or to use a single one across the application?
Best Answer
Note to preface answer - I am the author of Silverlight.FX, and architect for RIA Services ... so factor in bias in the reply :-) ...
I did two blog posts on the combination of the two you might find helpful: here and here. These cover basic view model scenarios using a DomainContext and basic unit testing of view models using the Silverlight Unit Test Framework.
Silverlight.FX offers more than just graphical interaction. From the site (http://projects.nikhilk.net/SilverlightFX):
The way to handle the notifications across view models would be to use some sort of event aggregator pattern that allows view models to publish and subscribe to events in a decoupled manner.
This feature isn't yet in Silverlight.FX, but is slated to go in hopefully soon. I demonstrated this sort of communication recently in my TechEd South Africa talk - check out the slides and code for an implementation of this: http://www.nikhilk.net/TechEd09-South-Africa-Samples.aspx.
Hope that helps.