Skip to content

Commit 93a181f

Browse files
committed
Merge branch 'main' into chore/dependencies
2 parents 844a9dd + 9940b3e commit 93a181f

File tree

11 files changed

+105
-23
lines changed

11 files changed

+105
-23
lines changed

.github/workflows/dotnet.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: windows-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 8.0.x
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
- name: Build
26+
run: dotnet build --no-restore
27+
- name: Test
28+
run: dotnet test --no-build --verbosity normal

MsGraphSamples.Services/AuthService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class AuthService : IAuthService
2222
private static readonly string[] _scopes = ["Directory.Read.All"];
2323

2424
private GraphServiceClient? _graphClient;
25-
25+
2626
//public GraphServiceClient GraphClient => _graphClient ??= new GraphServiceClient(GetAppCredential());
2727
public GraphServiceClient GraphClient => _graphClient ??= new GraphServiceClient(GetBrowserCredential());
2828

@@ -42,7 +42,7 @@ private InteractiveBrowserCredential GetBrowserCredential()
4242
var credentialOptions = new InteractiveBrowserCredentialOptions
4343
{
4444
ClientId = _configuration["clientId"],
45-
TokenCachePersistenceOptions = new TokenCachePersistenceOptions()// { UnsafeAllowUnencryptedStorage = true }
45+
TokenCachePersistenceOptions = new TokenCachePersistenceOptions()
4646
};
4747

4848
if (File.Exists(_tokenPath))

MsGraphSamples.Services/GraphExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public static async IAsyncEnumerable<T> Batch<T>(
114114
params RequestInformation[] requests)
115115
where T : IParsable, new()
116116
{
117-
BatchRequestContentCollection batchRequestContent = new(graphClient);
117+
var batchRequestContent = new BatchRequestContentCollection(graphClient);
118118

119-
var addBatchTasks = requests.Select(x => batchRequestContent.AddBatchRequestStepAsync(x));
119+
var addBatchTasks = requests.Select(request => batchRequestContent.AddBatchRequestStepAsync(request));
120120
var requestIds = await Task.WhenAll(addBatchTasks);
121121

122122
var batchResponse = await graphClient.Batch.PostAsync(batchRequestContent, cancellationToken, ErrorMappings);

MsGraphSamples.Services/MSGraphSamples.Services.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<ItemGroup>
1212
<PackageReference Include="Azure.Identity" Version="1.12.1" />
1313
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
14-
<PackageReference Include="Microsoft.Graph" Version="5.59.0" />
14+
<PackageReference Include="Microsoft.Graph" Version="5.60.0" />
15+
<PackageReference Include="System.Text.Json" Version="8.0.5" />
1516
</ItemGroup>
1617

1718
</Project>

MsGraphSamples.WPF/MsGraphSamples.WPF.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
20+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
2121
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
22-
<PackageReference Include="Microsoft.Graph" Version="5.59.0" />
22+
<PackageReference Include="Microsoft.Graph" Version="5.60.0" />
2323
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
2424
</ItemGroup>
2525

MsGraphSamples.WinUI/App.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
x:Class="MsGraphSamples.WinUI.App"
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6-
xmlns:local="using:MsGraphSamples.WinUI">
6+
xmlns:converters="using:CommunityToolkit.WinUI.Converters">
77
<Application.Resources>
88
<ResourceDictionary>
99
<ResourceDictionary.MergedDictionaries>
1010
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
1111
<!-- Other merged dictionaries here -->
1212
</ResourceDictionary.MergedDictionaries>
13+
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
14+
<converters:StringFormatConverter x:Key="StringFormatConverter" />
1315
<!-- Other app resources here -->
1416
</ResourceDictionary>
1517
</Application.Resources>

MsGraphSamples.WinUI/Helpers/Converters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MsGraphSamples.WinUI.Converters;
77

8-
public class AdditionalDataConverter : IValueConverter
8+
public partial class AdditionalDataConverter : IValueConverter
99
{
1010
public object Convert(object value, Type targetType, object parameter, string language)
1111
{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.UI.Xaml;
2+
3+
namespace MsGraphSamples.WinUI.Helpers;
4+
5+
public class Debouncer
6+
{
7+
private readonly DispatcherTimer timer;
8+
private Action? action;
9+
10+
public Debouncer(TimeSpan delay)
11+
{
12+
timer = new DispatcherTimer { Interval = delay };
13+
timer.Tick += Timer_Tick;
14+
}
15+
public void Debounce(Action action)
16+
{
17+
this.action = action;
18+
timer.Stop();
19+
timer.Start();
20+
}
21+
22+
private void Timer_Tick(object? sender, object e)
23+
{
24+
timer.Stop();
25+
action?.Invoke();
26+
}
27+
}

MsGraphSamples.WinUI/MsGraphSamples.WinUI.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<Platforms>x86;x64;arm64</Platforms>
@@ -12,7 +12,7 @@
1212
<ImplicitUsings>enable</ImplicitUsings>
1313
<Nullable>enable</Nullable>
1414
<PlatformTarget>x64</PlatformTarget>
15-
<SupportedOSPlatformVersion>10.0.22000.0</SupportedOSPlatformVersion>
15+
<SupportedOSPlatformVersion>10.0.26100.0</SupportedOSPlatformVersion>
1616
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
1717
<ApplicationIcon>Assets\MSGraph.ico</ApplicationIcon>
1818
</PropertyGroup>
@@ -30,12 +30,12 @@
3030
</ItemGroup>
3131

3232
<ItemGroup>
33-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
34-
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.240109" />
33+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
34+
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240916" />
3535
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
3636
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
37-
<PackageReference Include="Microsoft.Graph" Version="5.59.0" />
38-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
37+
<PackageReference Include="Microsoft.Graph" Version="5.60.0" />
38+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
3939
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
4040
<PackageReference Include="System.Text.Json" Version="8.0.5" />
4141
</ItemGroup>

MsGraphSamples.WinUI/Views/MainPage.xaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
66
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
7-
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
87
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
98
xmlns:graph="using:Microsoft.Graph.Models"
109
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -13,10 +12,7 @@
1312
Loaded="{x:Bind ViewModel.PageLoaded}"
1413
mc:Ignorable="d">
1514

16-
<Page.Resources>
17-
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
18-
<converters:StringFormatConverter x:Key="StringFormatConverter" />
19-
</Page.Resources>
15+
<Page.Resources />
2016

2117
<Grid Margin="0,28,0,0">
2218
<Grid.RowDefinitions>
@@ -184,14 +180,16 @@
184180
Margin="6"
185181
d:DataContext="{d:DesignInstance Type=graph:User}"
186182
AutoGenerateColumns="False"
183+
DataFetchSize="4"
187184
DoubleTapped="{x:Bind ViewModel.DrillDown}"
188-
Sorting="{x:Bind ViewModel.Sort}"
189185
GridLinesVisibility="Horizontal"
190-
IncrementalLoadingThreshold="0.6"
186+
IncrementalLoadingThreshold="2"
191187
IsReadOnly="True"
192188
ItemsSource="{x:Bind ViewModel.DirectoryObjects, Mode=OneWay}"
193189
SelectedItem="{x:Bind ViewModel.SelectedObject, Mode=TwoWay}"
194-
SelectionMode="Single">
190+
SelectionMode="Single"
191+
SizeChanged="DirectoryObjectsGrid_SizeChanged"
192+
Sorting="{x:Bind ViewModel.Sort}">
195193
<controls:DataGrid.Columns>
196194
<controls:DataGridTextColumn Binding="{Binding Id}" Header="id" />
197195
<controls:DataGridTextColumn Binding="{Binding DisplayName}" Header="displayName" />

0 commit comments

Comments
 (0)