I have a wpf-mvvm application. I have one textbox and one button (similar to FileUpload control). How can I display all folders under a given folder ..when user type it.
I mean similar to..when windows display all folders under c drive..when we type c:\ in start->RUN.
This is a broad question so I will give you an outline of a possible solution.
Each time the text in the
TextBoxchanges you would check whether that is a real folder on disk usingDirectory.Exists(). If it does exist you would callDirectory.GetDirectories()to get a list of all the subfolders. Add those subfolders to anObservableCollection<string>object and use anItemsControlorListBoxof some kind to bind to the collection of subfolders.How do you know when the text of the
TextBoxchanges as the user types? There are two ways. First way is to bind to a property and useUpdateSourceTrigger="PropertyChanged"in the binding so that the property is set as the user types. A second way would be to handle theTextBox‘sTextChangedevent.