I have created a FOLDER BROWSER control in WPF, and is working fine, but for only one drive that I hard code.
The document I followed to do so is :
http://msdn.microsoft.com/en-us/library/bb546972%28v=vs.90%29.aspx
I want to make it list all drives in the system in the treeview instead of only one.
<Window.Resources>
<ObjectDataProvider x:Key="RootFolderDataProvider">
<ObjectDataProvider.ObjectInstance>
<folderExplorer:FolderExplorer FullPath="e:\" />
</ObjectDataProvider.ObjectInstance>
</ObjectDataProvider>
<HierarchicalDataTemplate
DataType = "{x:Type folderExplorer:FolderExplorer}"
ItemsSource = "{Binding Path=SubFolders}">
<TextBlock Text="{Binding Path=Name}" />
</HierarchicalDataTemplate>
</Window.Resources>
<TreeView Grid.Column="0"
Name="RootTreeView"
Background="AliceBlue"
Foreground="Black" Grid.RowSpan="3" Margin="0,0,0,169">
<TreeViewItem Header="Browse">
<TreeViewItem.ItemsSource>
<Binding Source="{StaticResource RootFolderDataProvider}">
<Binding.Path>SubFolders</Binding.Path>
</Binding>
</TreeViewItem.ItemsSource>
</TreeViewItem>
</TreeView>
If I populate the treeview in the code behind, all my other code is breaking..
Any suggestion on how to make this list all drive will be very helpful.