BT

A Look at the Windows Community Toolkit for UWP

| by Jonathan Allen Follow 636 Followers on Aug 13, 2018. Estimated reading time: 3 minutes |

In order to address the needs of line of business developers, Microsoft is offering the Windows Community Toolkit for UWP. This rapidly changing library acts as a test ground for new UWP controls and features.

When UWP was first created, the emphasis was on smart phones and tablets. This meant most of the development budget was spent on controls that worked well when there is a limited room for displaying content. In other words, no data grids or dock panels. They didn't even have a wrap panel, as the screen wasn't wide enough to need the ability to wrap controls.

But now that Microsoft has turned its attention to the needs of line of business developers on large screens, there is a lot of catching up to do. They need the ability to rapidly iterate over the missing controls and features, something they can't do when tied to the Windows 10 release cycle. This is where the Windows Community Toolkit enters the picture.

The Windows Community Toolkit is based on three principles:

  • Principle #1: The toolkit will be kept simple
  • Principle #2: As soon as a comparable feature is available in the Windows SDK for Windows 10, it will be marked as deprecated
  • Principle #3: All features will be supported for two Windows SDK for Windows 10 release cycles or until another principle supersedes it

What this really means is anything you find in it should be treated as a preview. As the controls and features are stabilized, they'll be moved out of this library and into the platform itself. This fact is demonstrated by the 3.0 version, released only two months ago, already to be superseded by version 4.0.

Layout Controls

The Windows Community Toolkit is also where you'll find layout controls that WPF developers take for granted, such as the dock panel and wrap panel. You won't, however, find a basic tab control. That control is tentatively scheduled for the 5.0 release. Other layout controls include:

  • AdaptiveGridView presents items in an evenly-spaced set of columns to fill the total available display space, reacting to both changes in the layout and content
  • BladeView, which works with the master-details view and "is based on how the Azure Portal works"
  • MasterDetailsView, which looks like the Windows 10 email application
  • StaggeredPanel is a column layout where items are added to whichever column is shortest, making it useful for dashboard widgets

There are also stylistic views such as the Carousel, DropShadowPanel, OrbitView, and RotatorTile.

Other Controls

The rest of the controls mostly deal with menus and displaying content; input controls aren't represented here. One particularly interesting control is the MarkdownTextBlock. As the name implies, this is a read-only control that displays formatted markdown. It was originally developed for the open source Reddit app known as Baconit.

Animations and Brushes

While not generally used in business applications, there are 15 animations to choose from in the toolkit if you need them. You can further alter the appearance of your application using special brushes. (There is even a sepia brush for an old-timey look.)

Extensions and Helpers

More useful to LOB developers are the "extensions". These attached properties allow you to quickly do things such as apply input masks to text boxes, add item-clicked events and alter colors to list views, or alter the mouse pointer when hovering over a control.

Helpers are utility classes that don't directly interact with controls. This includes printing, disk and network I/O, object storage, and Bluetooth interactions. Most of these are things you have probably written yourself multiple times.

Services and Parsers

This set of classes deal with Microsoft and third-part web services including Bing, Facebook, LinkedIn, OneDrive, and Twitter. And though they may seem out of place, parsers for RSS and Markdown are also included in this toolkit.

Which returns us to one of the themes of the Windows Community Toolkit, which is to allow for rapid application development on the UWP platform.

The Windows Community Toolkit is open source and distributed under the MIT license.

Next in our series is a look at the new windowing options for UWP applications.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT