Skip to main content

Microsoft Graph: Developer Blog

Announcing XAML controls for Microsoft Graph in the Windows Community Toolkit

Today at UnoConf in Montreal, we are announcing that the Windows Community Toolkit now includes a preview of XAML controls for Microsoft Graph. To watch the announcement via live stream please tune in for the Uno Platform Keynote at 10:45AM EST available online here.

With this new addition to the Windows Community Toolkit you are able to easily authenticate and access Microsoft Graph in your Windows 10 appsThese controls work with UWP apps and in WPF/WinForms for Win32 apps via XAML Islands on .NET Core 3. In addition, with the help of Uno Platform, you will be able to run code not only on Windows but also on Android and iOS. 

This will be a first for the Windows Community Toolkit where we’ve shipped controls simultaneously to work for not only UWP, but XAML Islands, and the Uno Platform as well.  We look forward to continuing improving these controls and adding new graph-enabled controls in the coming months.

Get Started Today!

Today, we’ve released an early preview of these controls for both UWP and for Android with Uno. More info for support for XAML Islands and iOS will come soon. You can find all the instructions you need for getting started on our GitHub, where you can also provide feedback or contribute.

Available Preview Controls

We’re releasing the following three preview controls: Login, PersonView, and PeoplePicker.

These new controls are built on the .NET Graph SDK and authenticate with Microsoft Authentication Library (MSAL). Earlier this year at //Build, we announced the Microsoft Graph Toolkit for the web, these new Windows controls should feel right at home as we’ve leveraged their expertise, designs, and used similar property names to make it simple to use either Toolkit for whatever type of application you may be building.

For UWP, you just need to add a Client ID to get started:

And then start adding controls to your page: 

Login

The Login control is used to facilitate authentication with the Microsoft Identity platform.  It provides two states where the user is not signed in and provides a button to initiate the sign-in process.  If the user is signedin, they will see their profile image and can open a fly-out that provides the option to sign out. 

PersonView

The PersonView control can be used to display a person or contact using their picture, name and/or email address.

PeoplePicker

The PeoplePicker control allows a user to easily search for users and contacts from Microsoft Graph. It will show intermediate results with pictures (if available) and allow the user to select multiple people.

About the Windows Community Toolkit and Uno Platform

The Windows Community Toolkit is an MIT-licensed open source collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP and .NET applications for Windows 10. The toolkit is part of the .NET Foundation, an independent non-profit organization created to foster innovation in the .NET community.

The Uno Platform enables C# and UWP XAML based code to run not just on Windows, but on iOS, Android, and WebAssembly as well. Rather than learning UI-paradigms for each platform, the Uno Platform mimics the existing Windows APIs of the Universal Windows Platform and implements parts such as Windows.UI.XAML. Uno Platform is Open Source under an Apache 2.0 license and available on GitHub.

filter-icon