Monday, October 17, 2016

TreeView control for UWP apps

All this month, I'm taking some time each day to explore (and document) things that are related to UWP development that I haven't fully investigated or used before. While doing it over lunch each day I'm calling it #UWPLunch.

Many people have a good reason to require a treeview control but there isn't one included with the standard controls for the platform.
There are a few 3rd party ones but not everyone wants to use such controls.

Wouldn't it be good if Microsoft released such a control? After all, they have such a thing in their own apps.

Well, good news, such a control is coming.
There's a preview among the samples on GitHub. You'll find it at:

https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/XamlTreeView

If you want to use it you'll need to get the whole repository because of the way some of the project files are shared amongst various samples.

It's not a simple control and it's written in C++ so that may be an issue for you but it seems pretty robust to me.
It provides customization over indentation (staggering) and whether folders can be collapsed and expanded. IT also supports the dragging of items between folders. As shown in the image here.


It can also be easily styled. And not just the icons, as below.



0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.