Silverlighttoolkit has a domaindatasource control. This control is really cool with RIA domain service. What paging, sorting, filtering... are all cloudification, Drag Control, noneCodeIs extremely simple. However, the domaindatasource control is not compatible with the mvvm mode. If you use it, it is not the mvvm mode. Microsoft always makes some amazing Hello WorldProgramTo fool you like to drag control entry cainiao. I am used to it. Okay, today we are dragging controls .....
Add the domaindatasource control of silverlighttoolkit in the toolbox, drag it to the interface, drag a DataGrid, A datapager, and configure some properties. After the configuration, the XAML code is as follows:
Note that there is a query function in the background domainservice1.cs that is getmyentities (). Note that there is no code in XAML. CS.
Then press F5 to run the task. The page is displayed (and the page is displayed on the server), and the task is sorted (press the DataGrid column header to automatically display the page on the server, and you can also configure datasource. sortdescriptors) also has and filters (configure datasource. filterdescriptors) is also easy .... it's amazing.
Hate: if you are using the mvvm mode, move on. This control cannot be used at all!(The implementation method of viewmodel is described in my article.Article)
Additional reading
- Viewmodel
- Introducing an mvvm-friendly domaindatasource: The domaincollectionview
Is it a good idea to put domain datasource in viewmodel? No!
Read this article and this article.
Domaincollectionview Implement more powerful server-side paging/sorting/filtering/search-mvvm-friendly
View my article
Chapter
Entitylist <t>/domaincollectionview <t>
/Domaincollectionviewloader <t>