Lately I have been making an application for Windows mobile but I am pretty bad with design so I was looking for a control toolkit and came across the Fluid.NET controls, which is an open source control toolkit for Windows Mobile. Now there wasn't too much documentation on the site and it hadn't been updated for a while but they had a pretty decent looking example application which they offered the source for.
I based my project off their example, took me a while to figure out how to use some of their controls but now i have a bit more of an idea and i thought I'd share it.
Basically I'm trying to use the Fluid.NET listbox control to display the file system (so i can select a folder).
I started by using the ListBoxBase class from PasswordSafe, this class handles the general list type stuff, like changing the colour of selected list items etc.
Then I created a new Fluid Template this is the class used by the ListBox to populate the items in the list. Item layout goes in the InitControl() method then the actual content of the Item (In my case its based off a DirectoryInfo object) goes in the OnBindValue() method.
After I had the Template done I then created my listbox class (inheriting from the ListBoxBase) This class didnt need to do too much as most of the work is done in its base and the panel it goes in.
Now that we’ve got the classes done, time to put them to use. I have created a panel for browsing through the file system. All we need to do here is create an instance of our Listbox control and add a list of folders to the Folders Property.
This then loads all the folders in the devices root into the listbox. I have also added to the OnItemClick event to go deeper into the file system and a back button to go back to the parent directory.