WPF: directory binding

Is there an example somewhere bindings, for example ListBox, to a directory? I assume that this will be due to the actual binding to something related to FileSystemWatcher, in order to update accordingly ListBox.

+3
source share
2 answers

I do not know that you can bind to a directory. However, you can bind to ObserveableCollectionand then use events FileSystemWatcherto update this ObserveableCollection, which in turn will update your list.

+4
source

If you are using .NET 4, you can use the new Directory.EnumurateFiles .

IEnumerable, ObservableCollection, WPF MVVM

+2

All Articles