UWP Community Toolkit – What’s in there

Microsoft released a new UWP Community Toolkit with enhancements to the Windows SDK for Windows 10 containing new controls, animations, helpers, and service proxies. Of course, this is all open source. With this article I’m introducing the cool content of this toolkit.

Toolkit

UI

Of course you already created a visual tree helper to iterate through XAML elements. Now, with the NuGet package Microsoft.Toolkit.Uwp.UI, you can use extension methods to extend the FrameworkElement or DependencyObject types with the methods FindAscendant, FindDescendant, FindDescendantByName, and FindVisualAscendant.

How many visual tree helpers exist in your source code? Here’s one more – but you don’t have to write it.

This package also contains the class ImageCache that can cache images loaded from the Internet for a specified duration.
You can also find some converters in the package: BoolToVisibilityConverter, CollectionVisibilityConverter, StringFormatConverter, and StringVisibilityConverter.

With the Anniversary update of Windows 10, the BoolToVisibilityConverter is no longer needed. x:Bind can directly bind to Boolean values.

Animations

The NuGet package Microsoft.Toolkit.Uwp.UI.Animations offers easy animations for blur, fade, offset, rotate, and scale.

You can do easy animations for blur, fade, rotate…

Helpers

The NuGet package Microsoft.Toolkit.Uwp contains some helper classes for colors, connections, and storage:

  • The ConnectionHelper allows checking if internet is available, and if internet is on a metered connection
  • The ColorHelper converts colors from and to Hex, Int, color names, HSL, and HSV.
  • The StorageHelper allows easier reading and writing files

Notifications

The NuGet package Microsoft.Toolkit.Uwp.Notifications contains helper classes to generate tiles, toasts, and badge notifications. With these classes it is not necessary to define XML code for the content of the tiles and toasts – instead, use C# code.

Services

The NuGet package Microsoft.Toolkit.Uwp.Services contains service proxies for easy access of Bing, Facebook, and Twitter. I plan to use the Facebook API for an upcoming version of my MenuCard Manager.

Controls

The NuGet package Microsoft.Toolkit.Uwp.UI.Controls contains several useful controls:

  • AdaptiveGridView shows information in a Grid View based on the available space
  • HamburgerMenu contains a HamburgerButton with a SplitView and a ListView to display menu items
  • HeaderedTextBlock gives a Header property for a read-only text
  • ImageEx gives a powerful image control that shows a load indicator while image loading is in progress, and caches the image using the previously mentioned ImageCache
  • PullToRefreshListView extends the ListView control and offers a “pull to refresh” on touch devices
  • RadialGauge gives a modern UI radial gauge
  • RangeSelector is a double slider to select a range of values
  • RotatorTile is an items control to display different content from a list similar to the live tiles
  • SlideableListItem is a content control that offers functionality when sliding left or right

Many new useful controls are available with the UWP Community Toolkit

Summary

The UWP Community Toolkit offers new controls, easy access to Twitter and Facebook, and helper classes for tiles, toasts, and storage. Great features are available that make programming UWP applications easier. It’s open source, so you can extend it as well.

The UWP Community Toolkit Sample App shows all the features and the important parts of the source code when using it.

Have fun with programming and learning!

Christian

More Information

Introducing the UWP Community Toolkit

Source Code at GitHub

UWP Community Toolkit Sample App

UWP Workshop – available as a company-based workshop

Training

Professional C# 6 and .NET Core 1.0

Toolkit image © Olena Golubova | Dreamstime.com Сhooses wrench tools (screwdriver) in store (shop)

2 thoughts on “UWP Community Toolkit – What’s in there

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s