Silverlight treeview observablecollection not updating

Rated 3.84/5 based on 538 customer reviews

Tree View: The above figure shows the Tree View structure. The Item Template specifies how the items [Nodes] in the Tree View should be.

Item Template for Tree View: The snippet of Item Template is given below.

So we are loading the folders in the Selected Item Changed event of Tree View.

When a folder is clicked we are also loading the files into the selected folder.

This method will take the path of the folder and folder as parameter.

The [No: 1] section will check whether the folder clicked is My Computer or not.

For generating the parent and child folder structure we are using a class called Folder. In the Entire File System class we are using a Root Folder property which is of type Observable Collection to hold the child folders.

Loading Folders on Demand: If you ask "Is there any advantage of using this File Explorer", for this I can say that this File Explorer will load the folders on demand.

Yes, this application will load the child folder ONLY when the parent folder is clicked.

Preparing the Solution: Fire up the VS 2010; create a Silverlight application project with the name "File Explorer In Silverlight5Beta" as shown in the figure.

Open the Project's property window and select Silverlight. The XAML: As we are creating the File Explorer, we need to spend time on designing the Screen.

Leave a Reply