Print Page | Close Window

DataSource on DF Like WCF RIA

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1794
Printed Date: 21-Apr-2026 at 5:49am


Topic: DataSource on DF Like WCF RIA
Posted By: iosub
Subject: DataSource on DF Like WCF RIA
Date Posted: 07-May-2010 at 9:34am
HI..
 
I don't know if I'm something wrong or DF does not have this funcionality.
 
We I do a domain service with WCF ria, I can see on the client (SL) all my defined DS on the DataSource Window.
 
With DF the DataSource window is emptly..
 
This is very usefull feature especialy because the new SL4 Binding funcionality, Doing a drag&drop you can makes bindings automaticaly..
 
Does DF support this??
 
 
Thanks!
 



Replies:
Posted By: WardBell
Date Posted: 10-May-2010 at 9:11pm
For me the Data Sources Window is a total pig ... for RIA Services applications as well as everyone else.
 
Anyway, you CAN use it with DevForce entities if you like.
 
I'm not an expert in it by any means but I have found that I can do the things I see in demos by adding the entities I want to the Data Sources window and then dragging-and-dropping as desired.
 
Here's a recipe that works for me. I just tried it as a modification of our "DevForce Silverlight Tour" application.
  • Build your solution (or you won't see the model project)
  • Open the xaml class file (can be in either XAML or Designer view)
  • Open the Data Sources window
  • Click "Add New Data Source"; Data Source Configuration Wizard dialog opens
  • Pick the "Object" data source type
  • Open the node to the project with your model (if not shown, you may have forgotten to build)
  • Check the checkbox(es) next to the entities you'll be binding (e.g, Customer, Employee)
  • Click "Finish" button

They should appear in the Data Sources window ... after a pause.

They frequently disappear from the window and it takes awhile (a long while) for Visual Studio to rebuild that window. You will notice that the window rebuilds itself (painfully) seemingly on a whim.
 
Note that the data sources you created are listed in the DataSources folder under your project's Properties folder
  • Twiddle with your Data Source to get it the way you want it (see any demo)
  • Drag source on to canvas (see any demo)
  • REPAIR !!!

You will almost certainly need to go into the XAML to deal with the junk piled into it.

The generated CollectionView resource is useless to me because I use MVVM. It may be that I just don't know how to use it properly. If I seem less uninterested in it ... that's because I am. You're welcome to follow your own star on this.
 
Anyway, for me, the CollectionView has done its job and so I soon delete it and the StaticResource binding of the DataGrid (DG)'s or DataForm (DF)'s DataContext to that CollectionView.
 
I bind DG or DF ItemsSource to the relevant collection property (typically an ObservableCollection<T>) of the ViewModel (e.g,. "vm.Employees").
 
The critical thing for,  both of us I believe, is that we can enter the View's Designer Mode and use the Binding Wizards (e.g., Columns "Collection Editor" to adjust the column order and other characteristics) .
 
Note: you pay an awful performance price for keeping these DataSources around. This is not a DevForce thing. The price is high for everyone and if you live with the RIA Services demos for awhile you'll experience what I mean there too.
 
They aren't helping much once you have your view wired up so you might want to delete them or at least remove them from the project (you can keep them physically on disk and in Source Control).
 
You can bring them back later if you have to add back a column or field ... but you'll probably just do that in XAML. Maybe you'll want them back for designing other views against the same entity data sources.
 
In a future post I'll be showing an alternative approach that involves using DevForce entities as design data.


Posted By: iosub
Date Posted: 11-May-2010 at 4:38am
Hi
 
Yes I see you point, And you are right they are slow... I know.
 
I want to test another thing.. If you don't have thouse slow datasources , can you do all the new Binding Features of SL4 with the property window??? I will check but I think is posible.
 
Also, the best is your last coment "In a future post I'll be showing an alternative approach that involves using DevForce entities as design data.".. Hope is soon
 
Thank you for your help!
 
Iosu


Posted By: WardBell
Date Posted: 11-May-2010 at 3:48pm
YES you can use the Binding Wizards in the property window just like they do in RIA Services demos ... because that's all just Silverlight tooling ... nothing specific to RIA Services at all. Works great.
 
I'm excited about doing the design data with DevForce. I need the forthcoming release of DF 2010 though. We had to fix a few gotchas that inhibited design data in SL (it works in WPF).
 
Keep your eye out us :-)


Posted By: iosub
Date Posted: 12-May-2010 at 3:15pm
Hi
 
That's great!
 
What is the time frame for the the Fothcoming release?
 
Thanks!
 


Posted By: WardBell
Date Posted: 12-May-2010 at 4:05pm
June. Subject to change but we are on track.



Print Page | Close Window