Wednesday 15 June 2011

Trouble using CollectionViewSource in Silverlight -


I'm having some trouble executing collection ViewSource in SilverView. I'm new to this topic, so basically I Want to search through the web? Even I am trying to do this.

I am creating collection ViewSource in the resource tag:

  & lt; UserControl.Resources & gt; & Lt; CollectionWeasource x: key = "testcvs" & gt; & Lt; CollectionViewSource.SortDescriptions & gt; & Lt; Scm: sorted descriptions property name = "value" direction = "ascend" /> & Lt; /CollectionViewSource.SortDescriptions> & Lt; / CollectionViewSource & gt; & Lt; /UserControl.Resources>  

Then I am binding my TestCVS in a HierarchicalDataTemplate:

   & Lt; Roadfinition /> & Lt; /Grid.RowDefinitions> & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "Auto" /> & Lt; Column width = "*" /> & Lt; /Grid.ColumnDefinitions> & Lt; StackPanel Orientation = "Horizontal" Horizontal Alignment = "Left" & gt; & Lt; TextBlock TextWrapping = "Wrap" text = "{MyClassField binding}" /> & Lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; / Border & gt; & Lt; / Common: HierarchicalDataTemplate & gt; & Lt; / Common: HierarchicalDataTemplate.ItemTemplate & gt; & Lt; / Common: HierarchicalDataTemplate & gt;  

Now, in the back code, I am specifying the source of test CVS in an asset such as:

  Private Observation Collection & lt; MyClass & gt; _my class; Public Supervision Collection & lt; MyClass & gt; MyCalus {_MyClass;} set {var testCVS = (this is the "Resource [" testcvs "] collection as a collection); if (testCVS! = Tap) testCVS.Source = value;}}  

After checking it, I realize that the information is not being displayed on the screen and I do not really know how anyone can help me in this matter?

Hope Thank you in advance!

I do not think you want to reset the source You need to use it.TestCVS = CollectionsViewerGet default view (my collection); Add a completed event and then add and remove it from myCollection You get notification of free changes with the freezingclass. Has not been fully tested, but should work in principle.

EDIT: It has been found that GetDefaultView is not present in Silverlight Only WPF I have used PagingCollectionView (myCOllection) successfully for grouping.


No comments:

Post a Comment