UWP Graph Controls Sample App
This module will introduce you to working with the Microsoft Graph Controls (AadLogin, ProfileCard, PeoplePicker, SharePointFileList) found in the Windows Community Toolkit in your own UWP application.
The Microsoft Toolkit Graph Controls depend on the MicrosoftGraphService to introduce a layer of abstraction for login authentication. Note that the underlying graph object is the same GraphServiceClient for both the Toolkit and the Graph SDK. For more custom control of graph integration, check out the Microsoft Graph Training Module - Build UWP apps with the Microsoft Graph .NET SDK.
Register the App to use Azure AD v2 Endpoint
- Go to the App Registration Portal
- Click in the "Add an app" button.
- Enter the app name and click "create"
- Once the App is created, copy the Application Id to use it later.
- Next, add a Platform to the App clicking in "Add Platform" and select "Native Application" tile.
- Scroll to the Microsoft Graph Permissions section (by default the User.Read permission is added). Add the following permissions:
- Finally, save your changes.
Extend the UWP app for Azure AD Authentication
Open the App.xaml file.
ida:ClientIDvalue to the one you copied when registering the Azure AD application.
<Application.Resources> <x:String x:Key="ida:ClientID">ENTER_APP_ID</x:String> </Application.Resources>
You can also set the app ID through the settings page of this sample.
Explore the Graph Controls
You can explore the different Graph Controls by clicking on control icons. Detailed documentations for each control can be found here: