views:

148

answers:

0

I'm using MVVM in a Silverlight application. So I use a PagedCollectionView as property of my View Model to bind it to a DataGrid ItemSource. But I have this requirement: "all groups in the Grid should be collapse when the user control is loaded.". As I'm using a Page collection View I used this code:

     this.PinesView = new PagedCollectionView(this.Pines);
     PinesView.GroupDescriptions.Add(new PropertyGroupDescription("Operador"));                        
     PinesView.GroupDescriptions.Add(new PropertyGroupDescription("Marca"));

Now I have the code to collapse the groups, but the only piece of code I found needs to run over the UI, so It's kinda difficult to link it to my ViewModel because that collectionview is filled Async, so I don't know how to comunicate about the collection is already filled to the UI to run this code; or even better, how to send that collapse instruction from my ViewModel to the UI.

Could you please help me?