Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
5722ddf
Copy over POC PeoplePicker code for transfer
michael-hawker Sep 17, 2019
cbd395c
Update PeoplePicker on top of all other dependencies
michael-hawker Sep 17, 2019
98eea19
Fix overlooked StyleCop Issues
michael-hawker Sep 17, 2019
99c7feb
Pull updates from Uno for Missing GenerateLibraryLayout and QuickCrea…
michael-hawker Sep 19, 2019
aabe8cf
Add PickedPeople property to PeoplePicker
michael-hawker Sep 19, 2019
fa01241
Merge pull request #7 from windows-toolkit/michael-hawker/people-pick…
michael-hawker Sep 19, 2019
23200f8
Update default scopes for sample
michael-hawker Sep 19, 2019
a79ad6a
Update ReadMe with Getting Started Instructions
michael-hawker Sep 19, 2019
91689f7
Update Microsoft.Toolkit.Graph package title
michael-hawker Sep 19, 2019
263119f
Switch from XAML Provider from DependencyObject to Behavior
michael-hawker Oct 19, 2019
c1f41d5
Fix PeoplePicker so doesn't suggest already picked people
michael-hawker Oct 19, 2019
8988341
Initial GraphPresenter prototype for #17
michael-hawker Oct 20, 2019
251d59b
Setup Initial XAML Islands Base Sample (initially unpackaged)
michael-hawker Oct 22, 2019
4277aed
Finish XAML Islands Sample and Provider WPF based Behavior Mirrors
michael-hawker Oct 22, 2019
b60660a
Link WPF Provider files to UWP versions and use Conditional Compilation
michael-hawker Oct 23, 2019
bee1560
Forgot about alternate redirect for .NET Core 3, update docs
michael-hawker Oct 23, 2019
2330744
Update Headers
michael-hawker Oct 23, 2019
e13653b
Add SdkVersion Header
michael-hawker Oct 23, 2019
3e3e946
Forgot header on new file
michael-hawker Oct 23, 2019
cbda5e7
Exclude Sample Apps from CI Build
michael-hawker Oct 25, 2019
f14889f
Remove native build step from cake script
michael-hawker Oct 25, 2019
d32ff79
Merge pull request #21 from windows-toolkit/michael-hawker/xamlisland…
azchohfi Oct 25, 2019
86a5830
Use MockProvider in Sample
michael-hawker Oct 30, 2019
559dbe9
Update Toolkit Dependencies to rc1
michael-hawker Nov 1, 2019
59744e4
Increment to 6.1 builds for previews
michael-hawker Nov 1, 2019
8d522d9
Fix searching for e-mails and converting strings to people
michael-hawker Nov 1, 2019
1eadc24
Merge pull request #23 from windows-toolkit/michael-hawker/rc1-update
michael-hawker Nov 1, 2019
2c1d935
Update Readme for Preview NuGet packages
michael-hawker Nov 1, 2019
bc9b12f
Add hack for MockProvider to workaround SDK issue
michael-hawker Nov 6, 2019
3189aeb
Merge pull request #25 from windows-toolkit/michael-hawker/mock-fix
michael-hawker Nov 7, 2019
e4f0d85
Create PULL_REQUEST_TEMPLATE.md
Kyaa-dost Dec 9, 2019
1b14589
Update feature_request emoji
Kyaa-dost Feb 19, 2020
dedb5bf
Update Question Emoji to automate bot
Kyaa-dost Feb 24, 2020
2027061
Merge pull request #35 from windows-toolkit/Update-QuestionEmoji
azchohfi Feb 24, 2020
2d6408b
Merge pull request #33 from windows-toolkit/update-fr-emoji
azchohfi Feb 24, 2020
e099909
Add Doc emoji
Kyaa-dost Feb 25, 2020
11e0c5b
Add Bug Emoji
Kyaa-dost Feb 25, 2020
caa2f5c
PR-Template Updated
Kyaa-dost Feb 26, 2020
b2f6a8e
Merge pull request #41 from windows-toolkit/Add-Bug-Emoji
azchohfi Feb 26, 2020
6504104
Merge pull request #40 from windows-toolkit/Add-Doc-Emoji
azchohfi Feb 26, 2020
5e875b1
Merge pull request #29 from windows-toolkit/Kyaa-dost-GraphControl-PR…
azchohfi Feb 26, 2020
d25988e
fixed logout flyout
vgromfeld Mar 2, 2020
a58334f
disable login button while login or logout
vgromfeld Mar 3, 2020
8b8bed2
Merge pull request #46 from vgromfeld/disableLoginButtonOnClick
vgromfeld Mar 17, 2020
6c89168
Merge branch 'master' into hideFlyoutOnClick
vgromfeld Mar 18, 2020
c7ba663
Update NuGet packages & to new TokenizingTextBox
michael-hawker May 17, 2020
7871983
Fix new StyleCop issues.
michael-hawker May 17, 2020
0195b3c
Update to netcoreapp3.1
michael-hawker May 18, 2020
a96dd84
Update readme for changes to Azure portal
michael-hawker Jun 9, 2020
fa0cf54
Update Dependencies
michael-hawker Jun 9, 2020
b8e80d5
Fix Xaml Islands building
michael-hawker Jun 10, 2020
522f931
Have PeoplePicker inherit from TokenizingTextBox
michael-hawker Jun 11, 2020
eb7423a
Fix showing Users in People Picker
michael-hawker Jun 12, 2020
a8670cc
Update Sample Pages
michael-hawker Jun 12, 2020
6666ff3
Merge pull request #51 from windows-toolkit/michael-hawker/update-tok…
michael-hawker Jun 12, 2020
712f97e
Merge pull request #45 from vgromfeld/hideFlyoutOnClick
michael-hawker Jun 12, 2020
07652fb
Update XML comment of Quick Create
michael-hawker Jun 12, 2020
67c6527
Update to 6.1.0 release build
michael-hawker Jun 15, 2020
268fdff
Merge branch 'master' into michael-hawker/graph-presenter
michael-hawker Jun 25, 2020
f6b6a0d
Update Example to use ImageEx to show something for files with no images
michael-hawker Jun 25, 2020
eedfc14
Update link to issue filed in Graph for the API we're trying to use
michael-hawker Jun 25, 2020
7d43dd8
Update Missing Headers
michael-hawker Jun 29, 2020
d5c0517
Changes from master to main for WCT-Graph-Controls; there are still m…
HerrickSpencer Jul 10, 2020
3a844f8
Merge remote-tracking branch 'origin/main' into michael-hawker/graph-…
michael-hawker Jul 16, 2020
0c04921
[Broken] CalendarView Example
michael-hawker Jul 16, 2020
e5b3013
Add forgotten .NET Foundation Header
michael-hawker Jul 16, 2020
2a9e157
Add OrderBy property to GraphPresenter
michael-hawker Jul 16, 2020
6556c2d
Try updating dependencies
michael-hawker Jul 23, 2020
ff9ee75
Fix Stylecop Issues
michael-hawker Jul 26, 2020
dc8a641
Reconfigure Proxy to work in all cases and more effectively
michael-hawker Jul 27, 2020
b70e6b7
Better separate out Samples in UWP app
michael-hawker Jul 27, 2020
f028d3f
Add (Mail) Messages GraphPresenter sample
michael-hawker Jul 27, 2020
a4919fb
Add Task sample to GraphPresenter
michael-hawker Aug 6, 2020
7cdd34f
Add in Teams Messages example to GraphPresenter
michael-hawker Aug 6, 2020
b93e18c
Remove unused OneDrive sample Converters
michael-hawker Aug 8, 2020
97d4eba
Initial PR Feedback
michael-hawker Aug 9, 2020
6e71a13
Apply suggestions from code review
michael-hawker Aug 9, 2020
bdabc31
Apply last feedback comment from @Sergio0694
michael-hawker Aug 9, 2020
4a45671
Add extra scopes needed for InteractiveProvider for new samples
michael-hawker Aug 10, 2020
8e58409
Update Project to Build with latest Uno package
michael-hawker Aug 10, 2020
77f3c69
Merge remote-tracking branch 'wct/michael-hawker/graph-presenter' int…
michael-hawker Aug 11, 2020
13b062b
Apply Work-Arounds for x:Bind in Uno
michael-hawker Aug 11, 2020
1864faf
Fix Provider Timing
michael-hawker Aug 11, 2020
3e3816d
Remove Nested ScrollViewers in Sample App
michael-hawker Aug 12, 2020
5368907
Remove duplicate line in pipeline yml file
michael-hawker Aug 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us fix something that isn't working as expected
title: ''
labels: bug
labels: "bug :bug:"
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Documentation
about: I have a documentation suggestion or question
title: "[Docs]"
labels: documentation
labels: "documentation :page_with_curl:"
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: I have a new idea or improvement for the toolkit
title: "[Feature]"
labels: feature request
labels: feature request 📬
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Question
about: I have a question about how to use something in the toolkit.
title: "[Question]"
labels: question
labels: "question :grey_question:"
assignees: ''

---
Expand Down
40 changes: 40 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Fixes #

<!-- Link to relevant issue (for ex: #1234) which will automatically close the issue once the PR is merged -->

## PR Type

What kind of change does this PR introduce?

<!-- Please uncomment one ore more that apply to this PR -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

## What is the new behavior?

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tested code with current [supported SDKs](https://github.com/windows-toolkit/Graph-Controls/blob/main/README.md)
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
- [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run _build/UpdateHeaders.bat_)
- [ ] Contains **NO** breaking changes

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below.
Please note that breaking changes are likely to be rejected -->

## Other information
21 changes: 11 additions & 10 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
<DefaultLanguage>en-US</DefaultLanguage>

<!--<TargetFrameworksOverride>xamarinios10</TargetFrameworksOverride>-->
<TargetFrameworksOverride>uap10.0.16299;MonoAndroid80;xamarinios10;netstandard2.0</TargetFrameworksOverride>
<TargetFrameworksOverride>uap10.0.17763;MonoAndroid90;xamarinios10;netstandard2.0</TargetFrameworksOverride>

<IsDesignProject>$(MSBuildProjectName.Contains('.Design'))</IsDesignProject>
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<IsUwpProject Condition="'$(IsDesignProject)' != 'true'">$(MSBuildProjectName.Contains('Uwp'))</IsUwpProject>
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
<IsWpfProject>$(MSBuildProjectName.Contains('Wpf'))</IsWpfProject>
<DefaultTargetPlatformVersion>17763</DefaultTargetPlatformVersion>
<DefaultTargetPlatformMinVersion>16299</DefaultTargetPlatformMinVersion>
<DefaultTargetPlatformMinVersion>17763</DefaultTargetPlatformMinVersion>
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
</PropertyGroup>

Expand Down Expand Up @@ -56,23 +57,23 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
</When>
</Choose>

<Choose>
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
<When Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true' and '$(IsWpfProject)' != 'true'">
<ItemGroup>
<!--<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.3.83" PrivateAssets="all" />-->
<!--<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="all" />-->
<!--<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />-->

<EmbeddedResource Include="**\*.rd.xml" />
<Page Include="**\*.xaml" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PropertyGroup Condition="'$(Configuration)' == 'Release' or '$(Configuration)' == 'CI'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</When>
Expand All @@ -82,7 +83,7 @@
<DefineConstants>$(DefineConstants);__WASM__</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'MonoAndroid80' or '$(TargetFramework)' == 'xamarinios10' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'MonoAndroid90' or '$(TargetFramework)' == 'xamarinios10' ">
<NoWarn>$(NoWarn);CS0649;CS0067;CS1998</NoWarn>
</PropertyGroup>

Expand All @@ -95,7 +96,7 @@
</PropertyGroup>

<ItemGroup Condition="!$([MSBuild]::IsOsUnixLike())">
<PackageReference Include="Nerdbank.GitVersioning" Version=" 2.1.65" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand All @@ -109,4 +110,4 @@
<JavaSdkDirectory Condition="'$(JavaSdkDirectory)'=='' and '$(JAVA_HOME_8_X64)'!=''">$(JAVA_HOME_8_X64)</JavaSdkDirectory>
</PropertyGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Microsoft.Graph;
using Microsoft.Toolkit.Uwp.Helpers;
using Newtonsoft.Json.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Microsoft.Toolkit.Graph.Controls
{
/// <summary>
/// Specialized <see cref="ContentPresenter"/> to fetch and display data from the Microsoft Graph.
/// </summary>
public partial class GraphPresenter : ContentPresenter
{
/// <summary>
/// Gets or sets a <see cref="IBaseRequestBuilder"/> to be used to make a request to the graph. The results will be automatically populated to the <see cref="ContentPresenter.Content"/> property. Use a <see cref="ContentPresenter.ContentTemplate"/> to change the presentation of the data.
/// </summary>
public IBaseRequestBuilder RequestBuilder
{
get { return (IBaseRequestBuilder)GetValue(RequestBuilderProperty); }
set { SetValue(RequestBuilderProperty, value); }
}

/// <summary>
/// Identifies the <see cref="RequestBuilder"/> dependency property.
/// </summary>
/// <returns>
/// The identifier for the <see cref="RequestBuilder"/> dependency property.
/// </returns>
public static readonly DependencyProperty RequestBuilderProperty =
DependencyProperty.Register(nameof(RequestBuilder), typeof(IBaseRequestBuilder), typeof(GraphPresenter), new PropertyMetadata(null));

/// <summary>
/// Gets or sets the <see cref="Type"/> of item returned by the <see cref="RequestBuilder"/>.
/// Set to the base item type and use the <see cref="IsCollection"/> property to indicate if a collection is expected back.
/// </summary>
public Type ResponseType { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the returned data from the <see cref="RequestBuilder"/> is a collection.
/// </summary>
public bool IsCollection { get; set; }

/// <summary>
/// Gets or sets list of <see cref="QueryOption"/> representing <see cref="Microsoft.Graph.QueryOption"/> values to pass into the request built by <see cref="RequestBuilder"/>.
/// </summary>
public List<QueryOption> QueryOptions { get; set; } = new List<QueryOption>();

/// <summary>
/// Gets or sets a string to indicate a sorting order for the <see cref="RequestBuilder"/>. This is a helper to add this specific request option to the <see cref="QueryOptions"/>.
/// </summary>
public string OrderBy { get; set; }

/// <summary>
/// Initializes a new instance of the <see cref="GraphPresenter"/> class.
/// </summary>
public GraphPresenter()
{
Loaded += GraphPresenter_Loaded;
}

private async void GraphPresenter_Loaded(object sender, RoutedEventArgs e)
{
// Note: some interfaces from the Graph SDK don't implement IBaseRequestBuilder properly, see https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/722
if (RequestBuilder != null)
{
var request = new BaseRequest(
RequestBuilder.RequestUrl,
RequestBuilder.Client); // TODO: Do we need separate Options here?
request.Method = "GET";
request.QueryOptions = QueryOptions?.Select(option => option.ToQueryOption())?.ToList() ?? new List<Microsoft.Graph.QueryOption>();

// Handle Special QueryOptions
if (!string.IsNullOrWhiteSpace(OrderBy))
{
request.QueryOptions.Add(new Microsoft.Graph.QueryOption("$orderby", OrderBy));
}

try
{
var response = await request.SendAsync<object>(null, CancellationToken.None).ConfigureAwait(false) as JObject;

//// TODO: Deal with paging?

var values = response["value"];
object data = null;

if (IsCollection)
{
data = values.ToObject(Array.CreateInstance(ResponseType, 0).GetType());
}
else
{
data = values.ToObject(ResponseType);
}

_ = DispatcherHelper.ExecuteOnUIThreadAsync(() => Content = data);
}
catch
{
// TODO: We should figure out what we want to do for Loading/Error states here.
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;

namespace Microsoft.Toolkit.Graph.Controls
{
/// <summary>
/// XAML Proxy for <see cref="Microsoft.Graph.QueryOption"/>.
/// </summary>
public partial class QueryOption : DependencyObject
{
/// <inheritdoc cref="Microsoft.Graph.Option.Name"/>
public string Name { get; set; }

/// <inheritdoc cref="Microsoft.Graph.Option.Value"/>
public string Value { get; set; }

/// <summary>
/// Constructs a <see cref="Microsoft.Graph.QueryOption"/> value representing this proxy.
/// </summary>
/// <returns><see cref="Microsoft.Graph.QueryOption"/> result.</returns>
public Microsoft.Graph.QueryOption ToQueryOption()
{
return new Microsoft.Graph.QueryOption(Name, Value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class LoginButton
/// <summary>
/// The user canceled the login process or was unable to sign in.
/// </summary>
public event EventHandler LoginFailed;
public event EventHandler<LoginFailedEventArgs> LoginFailed;

/// <summary>
/// The user started to logout - cancelable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public bool IsLoading
/// The identifier for the <see cref="IsLoading"/> dependency property.
/// </returns>
public static readonly DependencyProperty IsLoadingProperty =
DependencyProperty.Register("IsLoading", typeof(bool), typeof(LoginButton), new PropertyMetadata(true));
DependencyProperty.Register(nameof(IsLoading), typeof(bool), typeof(LoginButton), new PropertyMetadata(true));
}
}
Loading