Click here to Skip to main content
13,256,446 members (52,029 online)
Click here to Skip to main content
Add your own
alternative version


8 bookmarked
Posted 26 Apr 2012

WPF Folder Browser

, 26 Apr 2012
Rate this:
Please Sign up or sign in to vote.
This is an alternative for "WPF Folder Browser"


This version of the WPF Folder Browser introduces new basic functionality.

It offers

  • Automatic treeview folder opening and scrolling when the SelectedFolder is changed programmatically or via user input in the text box.
  • Update of SelectedFolder on enterkey down.  
  • Selection on double click. 


Sean Ireson liked the original solution so much that he went through the hassle of improving it and offer the code to the original poster for updating. Years later he was kind enough to email me his new code base to save me some time. Now I've made another tiny update which I think makes it worth to reshare.

Using the code

The changes to the original code done by Sean:

  • Introduction of the TreeViewItemBehaviour class introducing the DependencyProperty IsBroughtIntoViewWhenSelected
  • Modification to the BrowserViewModel by introducing the OnSelectedFolderChanged and Expand functions.
  • Addition of a text_box click event that selects and closes the form on double click on either text or treeview node.
  • I added the InputBindingManager class blatantly stolen from this StackOverflow answer by Samuel Jack. This enables the textbox to update the binding on enter key down events by creating an attached behaviour to the textbox in the XAML code. 

Points of Interest

The Attached Behavior is quite practical for use on templated controls.


Nothing so far.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Erik Rude
Software Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 3 Pin
Claire Streb15-May-12 11:43
memberClaire Streb15-May-12 11:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 26 Apr 2012
Article Copyright 2012 by Erik Rude
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid