Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial port to WinUI3. #36

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7b8289e
Initial port to WinUI3.
azchohfi Dec 4, 2019
613f8c7
Merge branch 'master' into winui
azchohfi Feb 25, 2020
9509fa8
Updated to WinUI 3.0 Alpha (February 2020).
azchohfi Feb 25, 2020
f0d6088
Added missing header.
azchohfi Feb 25, 2020
c74557b
Updated version.
azchohfi Feb 25, 2020
394a37b
Merge branch 'master' into winui
azchohfi Mar 23, 2020
0c34c1d
Changed version to 8.0.0.
azchohfi Mar 24, 2020
03cac28
Updated to WInUI3 preview1.
azchohfi May 17, 2020
f1f4f10
Fixed azure pipeline.
azchohfi May 18, 2020
f0aa843
Merge branch 'michael-hawker/update-tokenizing' into winui
azchohfi May 19, 2020
ed6f2ae
Minor fix on nuget.config
azchohfi May 19, 2020
3c2f904
Updated dependencies to 8.0.0-preview1.
azchohfi May 19, 2020
01441bb
Merge branch 'master' into winui
azchohfi Jun 26, 2020
b8306b2
Updated TFM to net5.0.
azchohfi Jun 30, 2020
3893aff
Small version update on dependency.
azchohfi Jun 30, 2020
d2ac527
Updated to new version of WinUI.
azchohfi Jul 1, 2020
066702e
Updated to new version of WinUI.
azchohfi Jul 8, 2020
a14dfa0
Updated to WinUI3-preview2.
azchohfi Jul 15, 2020
256c262
Merge branch 'main' into winui
azchohfi Jul 15, 2020
3ad99a6
Merge branch 'main' into winui
azchohfi Aug 20, 2020
19c10f9
Fixed .Net 5 Preview5 version
azchohfi Aug 20, 2020
907825c
Updated to new version of WinUI
azchohfi Oct 14, 2020
d752a39
Switched TFM to 18362.
azchohfi Oct 15, 2020
e6c2791
Merge branch 'main' into winui
azchohfi Nov 18, 2020
1cd784b
Updated to WinUI3 preview 3.
azchohfi Dec 11, 2020
15ee8c6
Updated WinUI to 3.0.0-preview4.210210.4.
azchohfi Feb 5, 2021
1534b83
Merge branch 'main' into winui
azchohfi Feb 11, 2021
2ec6d86
Removed unused usings.
azchohfi Feb 11, 2021
4935b3c
Updated to stable mains toolkit preview4 version.
azchohfi Feb 11, 2021
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ __pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
/build/tools/**
!/build/tools/packages.config

# Tabs Studio
*.tss
Expand Down
32 changes: 10 additions & 22 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@
<DefaultLanguage>en-US</DefaultLanguage>
<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>19041</DefaultTargetPlatformVersion>
<DefaultTargetPlatformVersion>18362</DefaultTargetPlatformVersion>
<DefaultTargetPlatformMinVersion>17763</DefaultTargetPlatformMinVersion>
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>$(TargetPlatformMinVersion)</SupportedOSPlatformVersion>
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
<NoWarn>CS8002;CS8305</NoWarn> <!-- Temporary since WinUI3 is not stable yet -->
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true'" >true</SignAssembly>
<SignAssembly Condition="'$(SignAssembly)' == ''" >true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

Expand All @@ -34,14 +41,6 @@
</When>
</Choose>

<Choose>
<When Condition="('$(IsUwpProject)' == 'true') and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
<PropertyGroup>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
</PropertyGroup>
</When>
</Choose>

<Choose>
<When Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false' and '$(IsSampleProject)' != 'true' and '$(IsDesignProject)' != 'true'">
<PropertyGroup>
Expand All @@ -64,24 +63,13 @@
<ItemGroup>
<!--<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.3.83" 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' or '$(Configuration)' == 'CI'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</When>
</Choose>

<PropertyGroup Condition="'$(IsUwpProject)' == 'true'">

<!-- 8002 is a strong named -> non-strong-named reference -->
<!-- This is valid for platforms other than .NET Framework (and is needed for the UWP targets -->
<NoWarn>$(NoWarn);8002</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
</ItemGroup>
Expand Down
20 changes: 0 additions & 20 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
<Project>
<Choose>
<When Condition="'$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.17763' or '$(TargetFramework)' == 'native' or '$(TargetFramework)' == 'net461'">
<!-- UAP versions for uap10.0 where TPMV isn't implied -->
<PropertyGroup>
<TargetPlatformVersion>10.0.$(DefaultTargetPlatformVersion).0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
<DebugType>Full</DebugType>
</PropertyGroup>

<ItemGroup>
<SDKReference Condition="'$(UseWindowsDesktopSdk)' == 'true' " Include="WindowsDesktop, Version=$(TargetPlatformVersion)">
<Name>Windows Desktop Extensions for the UWP</Name>
</SDKReference>
<SDKReference Condition="'$(UseWindowsMobileSdk)' == 'true' " Include="WindowsMobile, Version=$(TargetPlatformVersion)">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
</When>
</Choose>

<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
using System.Linq;
using System.Threading;
using Microsoft.Graph;
using Microsoft.System;
using Microsoft.Toolkit.Uwp.Extensions;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Newtonsoft.Json.Linq;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
// 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using Microsoft.Graph;
using Windows.UI.Xaml;
using Microsoft.UI.Xaml;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Toolkit.Graph.Providers;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
using System.Collections.ObjectModel;
using System.Linq;
using Microsoft.Graph;
using Microsoft.System;
using Microsoft.Toolkit.Graph.Extensions;
using Microsoft.Toolkit.Graph.Providers;
using Microsoft.Toolkit.Uwp.Extensions;
using Microsoft.Toolkit.Uwp.UI.Controls;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand All @@ -21,7 +22,7 @@ namespace Microsoft.Toolkit.Graph.Controls
/// </summary>
public partial class PeoplePicker : TokenizingTextBox
{
private DispatcherTimer _typeTimer = new DispatcherTimer();
private DispatcherQueueTimer _typeTimer = null;

/// <summary>
/// Initializes a new instance of the <see cref="PeoplePicker"/> class.
Expand Down Expand Up @@ -71,6 +72,11 @@ private void TokenBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChang

if (list != null)
{
if (_typeTimer == null)
{
_typeTimer = DispatcherQueue.CreateTimer();
}

_typeTimer.Debounce(
async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.Graph;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Imaging;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
using Microsoft.Graph;
using Microsoft.Toolkit.Graph.Extensions;
using Microsoft.Toolkit.Graph.Providers;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Imaging;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;

namespace Microsoft.Toolkit.Graph.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using Microsoft.Graph;
using Microsoft.Toolkit.Graph.Extensions;
using Windows.UI.Xaml.Data;
using Microsoft.UI.Xaml.Data;

namespace Microsoft.Toolkit.Graph.Converters
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>uap10.0.17763</TargetFramework>
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
<Title>Windows Community Toolkit Graph Controls</Title>
<PackageId>Microsoft.Toolkit.Graph.Controls</PackageId>
<Description>
Expand All @@ -13,23 +13,19 @@
- PeoplePicker: The PeoplePicker Control is a simple control that allows for selection of one or more users.
</Description>
<PackageTags>UWP Toolkit Windows Controls MSAL Microsoft Graph AadLogin ProfileCard Person PeoplePicker Login</PackageTags>
<SignAssembly>false</SignAssembly>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<LangVersion>8.0</LangVersion>
<Configurations>Debug;Release;CI</Configurations>
<Platforms>AnyCPU;ARM;ARM64;x64;x86</Platforms>
</PropertyGroup>

<ItemGroup>
<Content Include="Assets\person.png" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI" Version="7.0.0-preview4" />
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls" Version="7.0.0-preview4" />
<PackageReference Include="Microsoft.Toolkit.Uwp.UI" Version="8.0.0-preview4" />
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Behaviors" Version="8.0.0-preview4" />
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls" Version="8.0.0-preview4" />
<ProjectReference Include="..\Microsoft.Toolkit.Graph\Microsoft.Toolkit.Graph.csproj" />
<PackageReference Include="Microsoft.WinUI">
<Version>3.0.0-preview4.210210.4</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
</ItemGroup>
Expand All @@ -38,20 +34,14 @@
<PackageReference Include="Microsoft.Graph.Beta" Version="0.37.0-preview" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" />
</ItemGroup>

<ItemGroup>
<Page Update="Controls\PersonView\PersonView.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Content Update="Assets\person.png">
<Pack>true</Pack>
<!--<PackagePath>lib\$(TargetFramework)\$(AssemblyName)\Assets\person.png</PackagePath>-->
<!-- https://github.com/dotnet/sdk/issues/14155 -->
<PackagePath>lib\net5.0-windows10.0.18362\$(AssemblyName)\Assets\person.png</PackagePath>
</Content>
</ItemGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
<!-- https://weblogs.asp.net/rweigelt/disable-warnings-in-generated-c-files-of-uwp-app -->
<Target Name="PragmaWarningDisablePrefixer" AfterTargets="MarkupCompilePass2">
<ItemGroup>
<GeneratedCSFiles Include="**\*.g.cs;**\*.g.i.cs" />
</ItemGroup>
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#if DOTNET
using System.Windows;
#else
using Windows.UI.Xaml;
using Microsoft.UI.Xaml;
#endif

#if DOTNET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.Toolkit.Wpf.UI.Behaviors;
#else
using Microsoft.Toolkit.Uwp.UI.Behaviors;
using Windows.UI.Xaml;
using Microsoft.UI.Xaml;
#endif

#if DOTNET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.Toolkit.Graph.Providers;
#else
using System.Linq;
using Windows.System;
using Microsoft.System;
#endif

#if DOTNET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Microsoft.Toolkit.Graph.Providers;
#else
using System.Linq;
using Windows.UI.Xaml;
using Microsoft.UI.Xaml;
#endif

#if DOTNET
Expand Down
16 changes: 4 additions & 12 deletions Microsoft.Toolkit.Graph/Microsoft.Toolkit.Graph.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>uap10.0.17763;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Title>Windows Community Toolkit .NET Standard Graph Services</Title>
<Description>
This package includes .NET Standard code helpers such as:
- GraphExtensions: Helpers for common tasks related to the Microsoft Graph used by the Microsoft.Toolkit.Graph.Controls.
- GlobalProvider: A shared provider instance used by the Microsoft.Toolkit.Graph.Controls.
</Description>
<PackageTags>UWP Graph Toolkit Windows Provider extensions helpers</PackageTags>

<!-- This is a temporary workaround for https://github.com/dotnet/sdk/issues/955 -->
<DebugType>Full</DebugType>
<Configurations>Debug;Release;CI</Configurations>
<Platforms>AnyCPU;ARM;ARM64;x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.17763'">
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINRT</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Graph.Beta" Version="0.37.0-preview" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" />
<PackageReference Include="Microsoft.Toolkit" Version="7.0.0-preview4" />
<PackageReference Include="Microsoft.Toolkit" Version="8.0.0-preview4" />
</ItemGroup>

</Project>
Loading