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

Support .NET 9.0 #2215

Open
wants to merge 153 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
c4169ed
Point to the .NET 9.0 release candidate
bijington Sep 18, 2024
e8e4c21
Tweak versions in the pipeline
bijington Sep 18, 2024
0223b47
allow prerelease builds
bijington Sep 18, 2024
24f1026
Find overlapping versions for AnxroidX libraries
bijington Sep 18, 2024
616ca9c
Fix null reference type issue
bijington Sep 18, 2024
590d8df
Shift to TypedBindings
bijington Sep 18, 2024
39df165
Keep disabling IL2092 for NET9_0
bijington Sep 18, 2024
39de8a0
Mark types as Dynamically accessed
bijington Sep 18, 2024
51dc62d
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Sep 19, 2024
9514390
Patch up Analyzer unit tests
bijington Sep 19, 2024
5677465
Fix the AvatarView unit tests
bijington Sep 19, 2024
0e90207
Suppress warning disable IL2026
bijington Sep 19, 2024
0674abf
Update comments in Camera project
bijington Sep 19, 2024
446ed60
Update src/CommunityToolkit.Maui.Analyzers.UnitTests/Verifiers/CSharp…
bijington Sep 19, 2024
7e02482
Update src/CommunityToolkit.Maui.Analyzers.UnitTests/Verifiers/CSharp…
bijington Sep 19, 2024
8f1ab91
Include preview builds for benchmarks
bijington Sep 19, 2024
18e5892
Merge branch 'feature/sl-dotnet-nine' of github.com:CommunityToolkit/…
bijington Sep 19, 2024
d430867
Remove Obsolete code
brminnick Sep 19, 2024
bb378bd
Remove pragma now that unsafe code has been removed
brminnick Sep 19, 2024
92213aa
Update ICommunityToolkitBehavior.shared.cs
brminnick Sep 19, 2024
dce03ba
Update Expander.shared.cs
brminnick Sep 19, 2024
bc7d67b
`MainPage` -> `Windows[0].Page`
brminnick Sep 19, 2024
6d80b85
use `override CreateWindow(IActivationState)` to initialize AppShell
brminnick Sep 23, 2024
0756b7a
Increase to Xcode 16
brminnick Sep 26, 2024
a9e6143
Make use of a TypedBinding instance to workaround current limitations
bijington Oct 2, 2024
7a42193
Merge branch 'main' into feature/sl-dotnet-nine
bijington Oct 2, 2024
9303b48
Remove ifdef
brminnick Oct 4, 2024
de624c6
Enable `NuGetAudit`
brminnick Oct 14, 2024
39d1408
Add WarningsAsErrors for `NuGetAudit`
brminnick Oct 14, 2024
8dec573
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Oct 15, 2024
83ba19a
Remove Obsolete PopupService method
brminnick Oct 15, 2024
8bdbc6f
Update for .NET 9 RC 2
brminnick Oct 15, 2024
4dbaf75
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Oct 15, 2024
189c16d
Update Android dependencies
brminnick Oct 15, 2024
5daf804
Remove unrequired NuGet Packages
brminnick Oct 15, 2024
b66ae83
Fix Vulnerabilities
brminnick Oct 15, 2024
9be58a7
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Oct 15, 2024
c0b7a6e
Resolve NuGet Dependency Conflicts
brminnick Oct 15, 2024
552c31c
Remove reflection
brminnick Oct 16, 2024
e1e3f5e
Fix `Camera` Android Dependencies
brminnick Oct 16, 2024
9a0b537
Refactor return statement
brminnick Oct 16, 2024
2f20c4a
Fix nullability error
brminnick Oct 16, 2024
6f2817c
Merge branch 'feature/sl-dotnet-nine' of https://github.com/Community…
brminnick Oct 16, 2024
1996cd5
Update AppShell.xaml
brminnick Oct 16, 2024
e5bc87b
Increase to RC2
brminnick Oct 16, 2024
b6841ce
Use `static`
brminnick Oct 16, 2024
ecc7d50
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Oct 16, 2024
e119e53
Use `private protected` constructor
brminnick Oct 16, 2024
f2a36fd
Stop automatically assigning Behavior BindingContext
brminnick Oct 16, 2024
a9d4d38
Merge branch 'feature/sl-dotnet-nine' of https://github.com/Community…
brminnick Oct 16, 2024
7c004e4
Remove References to `TrySetBindingContextToAttachedViewBindingContext`
brminnick Oct 16, 2024
a5f0e86
Update BaseBehaviorTest.cs
brminnick Oct 16, 2024
c2bbb86
Refactor GravatarImageSource
brminnick Oct 16, 2024
0bae474
Update CommunityToolkit.Maui.Sample.csproj
brminnick Oct 16, 2024
cf4e34c
Merge branch 'feature/sl-dotnet-nine' of https://github.com/Community…
brminnick Oct 16, 2024
3210586
Update for CsWinRT1028, CsWinRT1030, XC0045, and XC0103
brminnick Oct 16, 2024
0594549
Use `partial` for source generators
brminnick Oct 16, 2024
298e12b
Use Syntax Highlighting for code blocks
brminnick Oct 16, 2024
eddf68f
Removed duplicate string
brminnick Oct 16, 2024
df98a42
Remove References to Application.Current.MainPage
brminnick Oct 16, 2024
0251dcf
Fix typos
brminnick Oct 16, 2024
47fcdd8
Update samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sam…
brminnick Oct 16, 2024
f6cddbd
Update samples/CommunityToolkit.Maui.Sample/Pages/Views/Expander/Expa…
brminnick Oct 16, 2024
7d0d182
Fix Find + Replace typo
brminnick Oct 16, 2024
cdfba47
Remove unused namespace
brminnick Oct 16, 2024
05dd7ec
Remove `MainPage`
brminnick Oct 16, 2024
c917bd0
Add BindingContext to Behaviors in Sample App
brminnick Oct 17, 2024
ce8deb8
Increase Android SupportedOSPlatformVersion to 26
brminnick Oct 17, 2024
1f9c06d
Fix XAML Warnings
brminnick Oct 17, 2024
0272350
Use `macos-15-arm64`
brminnick Oct 27, 2024
32ecaab
Update azure-pipelines.yml
brminnick Oct 27, 2024
26d43e1
Use Xcode version `16`
brminnick Oct 27, 2024
72857ba
Revert back to macOS14
brminnick Oct 27, 2024
eb6ac01
Merge branch 'main' into feature/sl-dotnet-nine
jfversluis Oct 31, 2024
810b69c
Use BindingMode.OneWay
brminnick Oct 31, 2024
7b52c4a
Fix PopupService Tests
brminnick Oct 31, 2024
8bfc313
Fix AvatarView Tests
brminnick Oct 31, 2024
813c143
Fix AvatarView Tests
brminnick Oct 31, 2024
43ffcdb
Fix ParentWindowTests
brminnick Oct 31, 2024
3c1acca
Resolve AppTheme Tests
brminnick Oct 31, 2024
d2b9d8b
Add `[RequiresUnreferencedCode]` attribute to `ValidationBehavior`
brminnick Nov 1, 2024
bb36172
Update BehaviorsGalleryPage.cs
brminnick Nov 1, 2024
c762fb2
`dotnet format`
brminnick Nov 1, 2024
6aedd2e
Remove `Obsolete` attributes from `dotnet format`
brminnick Nov 1, 2024
2cd0c7a
Update `Microsoft.CodeAnalysis.CSharp.Workspaces`
brminnick Nov 4, 2024
ac437a6
Update Sample App NuGet Packages to .NET 9
brminnick Nov 4, 2024
e3e6211
Remove Duplicate NuGet Packages
brminnick Nov 4, 2024
b916b28
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Nov 5, 2024
c19b3d6
Fix https://github.com/CommunityToolkit/Maui/issues/2109
brminnick Nov 5, 2024
b4869b7
Fix CameraView warnings
brminnick Nov 5, 2024
2dd57b5
Refactor ShowKeyboardAsync
brminnick Nov 5, 2024
27e218e
Refactor Code + Performance Improvements
brminnick Nov 5, 2024
928b19f
`dotnet format`
brminnick Nov 5, 2024
4284967
Remove unused using directives
brminnick Nov 5, 2024
3ef7ef9
Add `[EditorBrowsable(EditorBrowsableState.Never)]`
brminnick Nov 5, 2024
a983d56
Use `BindingBase.Create`
brminnick Nov 6, 2024
8d54b5e
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Nov 6, 2024
8e00d1c
Update Options.cs
brminnick Nov 6, 2024
800dd72
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Nov 7, 2024
e066f17
Renaming and changing ValidationFlags.ValidateOnFocus and ValidateOnU…
CliffAgius Nov 7, 2024
7713aab
Fix compiled bindings For MediaElement
ne0rrmatrix Nov 8, 2024
01575bb
Fix Windows crash on exiting Page or Application when using Media Ele…
ne0rrmatrix Nov 8, 2024
fdd8168
Remove trace log added by accident
ne0rrmatrix Nov 8, 2024
5924b2a
Fix `MultiValidationBehavior` compiled bindings
ne0rrmatrix Nov 8, 2024
9d63b86
Fix `MultiConverterPage` Compiled Bindings
ne0rrmatrix Nov 8, 2024
36b6b72
Remove `x:DataType` from several lines
ne0rrmatrix Nov 8, 2024
95b2ff1
Add using to enable support for logging
ne0rrmatrix Nov 8, 2024
23fe7c9
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Nov 8, 2024
2248d70
Fix `ColorsConverterPage` compiled bindings. This casts the `x:DataTy…
ne0rrmatrix Nov 8, 2024
da066cd
Set `x:DataType` in `AppShell.xaml` to support compiled bindings
ne0rrmatrix Nov 9, 2024
752e8a1
Update `LazyViewPage` to add support for compiled bindings
ne0rrmatrix Nov 9, 2024
0fdb280
Update `EmailValidationBehaviorPage` to support Compiled bindings
ne0rrmatrix Nov 9, 2024
e538eed
Update params collections
brminnick Nov 10, 2024
0eb39a8
Update Xcode logic
brminnick Nov 10, 2024
7d609a1
Update azure-pipelines.yml
brminnick Nov 10, 2024
8cb078c
Update azure-pipelines.yml
brminnick Nov 10, 2024
6e5c417
Update azure-pipelines.yml
brminnick Nov 10, 2024
2238534
Increase to macOS-15
brminnick Nov 11, 2024
67a7caf
Add SourceLink
brminnick Nov 11, 2024
a3a83aa
Update CommunityToolkit.Maui.Sample.csproj
brminnick Nov 11, 2024
0260cef
Merge branch 'main' into feature/sl-dotnet-nine
brminnick Nov 11, 2024
7065b2d
Update PopupServiceTests.cs
brminnick Nov 11, 2024
5bda93d
Resolve Failing DrawingView Unit Tests
brminnick Nov 11, 2024
b0c9ee0
Use Partial Properties
brminnick Nov 12, 2024
f4fb321
Support `CarouselViewHandler2` + `CollectionViewHandler2` for MediaEl…
brminnick Nov 12, 2024
700a82b
Update comment text
brminnick Nov 12, 2024
503cf4e
Update for .NET 9 GA
brminnick Nov 12, 2024
8bd0184
Update samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sam…
brminnick Nov 12, 2024
cc5a669
Add `x:DataType` for Compiled Bindings
brminnick Nov 12, 2024
acf646c
Update NuGet Packages
brminnick Nov 12, 2024
90b6baa
Remove reference
brminnick Nov 12, 2024
5762236
Update CommunityToolkit.Maui.Sample.csproj
brminnick Nov 12, 2024
1d524c3
Sort alphabetically
brminnick Nov 12, 2024
f30f541
Set Behavior BindingContext
brminnick Nov 12, 2024
660c27d
Merge branch 'feature/sl-dotnet-nine' of https://github.com/Community…
brminnick Nov 12, 2024
bd8d383
Enable IServiceProvider
brminnick Nov 12, 2024
89eb97b
Fix compareconverter demo
brminnick Nov 12, 2024
6c5816e
Fix Crash
brminnick Nov 12, 2024
bdc00fc
Fix Behavior Binding
brminnick Nov 12, 2024
28a9e54
Add Behavior BindingContext
brminnick Nov 12, 2024
e1fdb07
Add behavior BindingContext
brminnick Nov 12, 2024
6363975
Fix DrawingView sample
brminnick Nov 13, 2024
ded531f
Use Enum.IsDefined<T>
brminnick Nov 13, 2024
e2fc7e7
Fix Expander Binding
brminnick Nov 13, 2024
67fb9a4
Update Maps for async/await + Trimming
brminnick Nov 13, 2024
9fce650
Catch Element Not Found Exception
brminnick Nov 13, 2024
d53c847
Modify CompareConverter signature to match IsInRangeConverter
bijington Nov 13, 2024
f043544
Update Directory.Build.props
brminnick Nov 14, 2024
0e991c2
run `dotnet workload update` following `dotnet workload install maui`
brminnick Nov 14, 2024
c240aea
Update azure-pipelines.yml
brminnick Nov 15, 2024
7d2f431
Revert "Update azure-pipelines.yml"
brminnick Nov 15, 2024
c84e785
Use Primary Constructor, Update Formatting
brminnick Nov 15, 2024
bfb9629
Disable warnings on compiler-generated code
brminnick Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,10 @@ dotnet_diagnostic.CA2208.severity = error
dotnet_diagnostic.CA1834.severity = error

# IDE0220: Add explicit cast
dotnet_diagnostic.IDE0220.severity = error
dotnet_diagnostic.IDE0220.severity = error

# Warning CA2264 : Calling 'ArgumentNullException.ThrowIfNull' and passing a non-nullable value is a no-op
dotnet_diagnostic.CA2264.severity = error

# IDE0220: The field [ObservableProperty] can be converted to a partial property
dotnet_diagnostic.MVMTK0042.severity = error
65 changes: 51 additions & 14 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<PropertyGroup>
<NetVersion>net8.0</NetVersion>
<MauiPackageVersion>8.0.71</MauiPackageVersion>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>NETSDK1023</NoWarn>
<NetVersion>net9.0</NetVersion>
<LangVersion>preview</LangVersion>
<MauiPackageVersion>9.0.0-rc.2.24503.2</MauiPackageVersion>
brminnick marked this conversation as resolved.
Show resolved Hide resolved
<ImplicitUsings>enable</ImplicitUsings>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>

<!-- Prevent NuGet Package Vulnerabilities -->
<NuGetAudit>enable</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>

<!-- MAUI Specific -->
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>

<!-- https://learn.microsoft.com/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows -->
<StripSymbols>false</StripSymbols>
Expand Down Expand Up @@ -39,18 +47,30 @@
CS1712: Type parameter has no matching typeparam tag in the XML comment
CS1723: XML comment has cref attribute that refers to a type parameter
CS1734: XML comment has a paramref tag, but there is no parameter by that name

MVMTK0042: The field [ObservableProperty] can be converted to a partial property
CsWinRT1028: Class implements WinRT interfaces but isn't marked partial
CsWinRT1030: Class implements WinRT interfaces that require unsafe code
NU1900 Error communicating with package source, while getting vulnerability information.
NU1901 Package with low severity detected
NU1902 Package with moderate severity detected
NU1903 Package with high severity detected
NU1904 Package with critical severity detected
NU1905 An audit source does not provide a vulnerability database
xUnit1012: Null should not be used for type parameter
xUnit2021: Assert.ThrowsAsync is async. The resulting task should be awaited

IL2***: Trim Warnings

IL3***: AOT Warnings

XC0045: Binding: Property not found
XC0103: Consider attributing the markup extension with [RequireService] or [AcceptEmptyServiceProvider] if it doesn't require any
IL2***: Trim Warnings
IL3***: AOT Warnings
RS2007: Analyzer release file 'AnalyzerReleases.Shipped.md' has a missing or invalid release header-->
<WarningsAsErrors>nullable,
<WarningsAsErrors>
nullable,
CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1587,CS1589,CS1590,CS1591,CS1592,CS1598,CS1658,CS1710,CS1711,CS1712,CS1723,CS1734,
CsWinRT1028,CsWinRT1030,
MVMTK0042,
NU1900,NU1901,NU1902,NU1903,NU1904,NU1905,
xUnit1012,xUnit2021,
XC0045,XC0103,
IL2001,IL2002,IL2003,IL2004,IL2005,IL2006,IL2007,IL2008,IL2009,
IL2010,IL2011,IL2012,IL2013,IL2014,IL2015,IL2016,IL2017,IL2018,IL2019,
IL2020,IL2021,IL2022,IL2023,IL2024,IL2025,IL2026,IL2027,IL2028,IL2029,
Expand All @@ -69,10 +89,27 @@
</WarningsAsErrors>
</PropertyGroup>

<!-- Required for NuGet Source Link -->
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true'">
<!-- Ensure deterministic build when using Azure Pipelines or GitHub Actions-->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>

<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<!-- Embed symbols containing Source Link in the main file (exe/dll) -->
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="CommunityToolkit.Maui.UnitTests" />
<InternalsVisibleTo Include="CommunityToolkit.Maui.Analyzers.UnitTests" />
</ItemGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' and $([MSBuild]::IsOSPlatform('windows')) == 'true'">

<PropertyGroup Condition="('$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true') and $([MSBuild]::IsOSPlatform('windows')) == 'true'">
<IncludeTizenTargetFrameworks>true</IncludeTizenTargetFrameworks>
</PropertyGroup>
</Project>
33 changes: 20 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ variables:
NugetPackageVersionCamera: '$(CurrentSemanticVersion)'
NugetPackageVersionMediaElement: '$(CurrentSemanticVersion)'
NugetPackageVersionMaps: '$(CurrentSemanticVersion)'
TOOLKIT_NET_VERSION: '8.0.303'
LATEST_NET_VERSION: '8.0.x'
TOOLKIT_NET_VERSION: '9.0.100-rc.2.24474.11'
brminnick marked this conversation as resolved.
Show resolved Hide resolved
LATEST_NET_VERSION: '9.0.x'
PathToLibrarySolution: 'src/CommunityToolkit.Maui.sln'
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Sample.sln'
PathToCommunityToolkitCsproj: 'src/CommunityToolkit.Maui/CommunityToolkit.Maui.csproj'
Expand All @@ -29,7 +29,7 @@ variables:
PathToCommunityToolkitAnalyzersBenchmarkCsproj: 'src/CommunityToolkit.Maui.Analyzers.Benchmarks/CommunityToolkit.Maui.Analyzers.Benchmarks.csproj'
DotNetMauiRollbackFile: 'https://maui.blob.core.windows.net/metadata/rollbacks/8.0.6.json'
CommunityToolkitSampleApp_Xcode_Version: '16'
CommunityToolkitLibrary_Xcode_Version: '15.4'
CommunityToolkitLibrary_Xcode_Version: '16'

trigger:
branches:
Expand Down Expand Up @@ -61,22 +61,25 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
- task: CmdLine@2
displayName: 'Set Xcode v$(CommunityToolkitSampleApp_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
inputs:
script: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app/Contents/Developer
script: |
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitSampleApp_Xcode_Version).app/Contents/Developer

- task: UseDotNet@2
displayName: 'Install Latest .NET SDK, v$(LATEST_NET_VERSION)'
inputs:
packageType: 'sdk'
version: '$(LATEST_NET_VERSION)'
includePreviewVersions: false
includePreviewVersions: true
brminnick marked this conversation as resolved.
Show resolved Hide resolved

- task: CmdLine@2
displayName: 'Install Latest .NET MAUI Workload'
Expand Down Expand Up @@ -139,7 +142,7 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
Expand Down Expand Up @@ -199,14 +202,17 @@ jobs:
displayName: 'Set Xcode v$(CommunityToolkitLibrary_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
inputs:
script: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app/Contents/Developer
script: |
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app/Contents/Developer

- task: UseDotNet@2
displayName: Install .NET v$(TOOLKIT_NET_VERSION)
inputs:
packageType: 'sdk'
version: '$(TOOLKIT_NET_VERSION)'
includePreviewVersions: false
includePreviewVersions: true
brminnick marked this conversation as resolved.
Show resolved Hide resolved

- task: CmdLine@2
displayName: 'Install .NET MAUI Workload $(TOOLKIT_NET_VERSION)'
Expand Down Expand Up @@ -451,13 +457,14 @@ jobs:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
image: 'macos-15'
pool:
vmImage: $(image)
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app
sudo xcode-select -p
echo Installed Xcode Versions:
ls -al /Applications | grep Xcode
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(CommunityToolkitLibrary_Xcode_Version).app/Contents/Developer
displayName: 'Set Xcode v$(CommunityToolkitLibrary_Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS

Expand All @@ -466,7 +473,7 @@ jobs:
inputs:
packageType: 'sdk'
version: '$(LATEST_NET_VERSION)'
includePreviewVersions: false
includePreviewVersions: true
brminnick marked this conversation as resolved.
Show resolved Hide resolved

- task: CmdLine@2
displayName: 'Install .NET MAUI Workload'
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.303",
"version": "9.0.100-rc.2.24474.11",
brminnick marked this conversation as resolved.
Show resolved Hide resolved
"rollForward": "latestFeature",
"allowPrerelease": false
"allowPrerelease": true
brminnick marked this conversation as resolved.
Show resolved Hide resolved
}
}
8 changes: 6 additions & 2 deletions samples/CommunityToolkit.Maui.Sample/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ namespace CommunityToolkit.Maui.Sample;

public partial class App : Application
{
public App()
readonly AppShell appShell;

public App(AppShell appShell)
{
InitializeComponent();

MainPage = new AppShell();
this.appShell = appShell;
}

protected override Window CreateWindow(IActivationState? activationState) => new(appShell);
}
5 changes: 3 additions & 2 deletions samples/CommunityToolkit.Maui.Sample/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
x:Name="flyout"
Title="{OnPlatform WinUI='Toolkit Features', Default={x:Null}}"
FlyoutBackgroundColor="{OnPlatform WinUI=Transparent,
Default={AppThemeBinding Light={StaticResource White},
Dark={StaticResource Black}}}"
Default={AppThemeBinding Light= White,
Dark= Black}}"
FlyoutBehavior="{OnPlatform WinUI=Locked, Default=Flyout}">

<Shell.FlyoutHeader>
Expand Down Expand Up @@ -100,6 +100,7 @@
<Shell.FlyoutFooter>
<Label Padding="4"
HorizontalOptions="End"
x:DataType="{x:Type sys:DateTime}"
Text="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:yyyy}'}"
VerticalOptions="End" />
</Shell.FlyoutFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

<WindowsSdkPackageVersion>10.0.19041.53</WindowsSdkPackageVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- Remove this NoWarn once XamlTypeInfo Generator (owned by .NET MAUI Engineering Team) implements a partial class-->
<NoWarn>CsWinRT1028</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'
Expand Down Expand Up @@ -64,17 +67,17 @@
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<PackageReference Include="Microsoft.Maui.Controls" Version="*" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)" />
brminnick marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0-preview1" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0-preview.9.24507.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.2.24473.5" />
brminnick marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<PropertyGroup>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">26.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace CommunityToolkit.Maui.Sample.Converters;
/// Compares a double value against the ComparingValue property
/// and returns a <see cref="Color"/> based on the comparison.
/// </summary>
public sealed class CompareDoubleToColorConverter : CompareConverter<double, Color>
[AcceptEmptyServiceProvider]
public sealed partial class CompareDoubleToColorConverter : CompareConverter<double, Color>
{
}
9 changes: 9 additions & 0 deletions samples/CommunityToolkit.Maui.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public static MauiApp CreateMauiApp()
.UseMauiCommunityToolkitCamera()
.UseMauiCommunityToolkitMediaElement()

.ConfigureMauiHandlers(handlers =>
{
#if IOS || MACCATALYST
handlers.AddHandler<CollectionView, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>();
handlers.AddHandler<CarouselView, Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2>();
#endif
})

#if WINDOWS
.UseMauiCommunityToolkitMaps("KEY") // You should add your own key here from bingmapsportal.com
#else
Expand Down Expand Up @@ -112,6 +120,7 @@ public static MauiApp CreateMauiApp()
builder.Services.AddHttpClient<ByteArrayToImageSourceConverterViewModel>()
.AddStandardResilienceHandler(static options => options.Retry = new MobileHttpRetryStrategyOptions());

builder.Services.AddSingleton<AppShell>();
builder.Services.AddSingleton<PopupSizeConstants>();

RegisterViewsAndViewModels(builder.Services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace CommunityToolkit.Maui.Sample.Pages.Alerts;

public class AlertsGalleryPage(IDeviceInfo deviceInfo, AlertsGalleryViewModel alertsGalleryViewModel) : BaseGalleryPage<AlertsGalleryViewModel>("Alerts", deviceInfo, alertsGalleryViewModel)
public partial class AlertsGalleryPage(IDeviceInfo deviceInfo, AlertsGalleryViewModel alertsGalleryViewModel) : BaseGalleryPage<AlertsGalleryViewModel>("Alerts", deviceInfo, alertsGalleryViewModel)
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ void Snackbar_Shown(object? sender, EventArgs e)

async void DisplaySnackbarInModalButtonClicked(object? sender, EventArgs e)
{
if (Application.Current?.MainPage is not null)
if (Application.Current?.Windows[0].Page is Page mainPage)
{
await Application.Current.MainPage.Navigation.PushModalAsync(new ContentPage
await mainPage.Navigation.PushModalAsync(new ContentPage
{
Content = new VerticalStackLayout
{
Spacing = 12,

Children =
{
new Button { Command = new AsyncRelayCommand(token => Snackbar.Make("Snackbar in a Modal Page").Show(token)) }
new Button { Command = new AsyncRelayCommand(static token => Snackbar.Make("Snackbar in a Modal MainPage").Show(token)) }
.Top().CenterHorizontal()
.Text("Display Snackbar"),

new Label()
.Center().TextCenter()
.Text("This is a Modal Page"),
.Text("This is a Modal MainPage"),

new Button { Command = new AsyncRelayCommand(Application.Current.MainPage.Navigation.PopModalAsync) }
new Button { Command = new AsyncRelayCommand(mainPage.Navigation.PopModalAsync) }
.Bottom().CenterHorizontal()
.Text("Back to Snackbar Page")
.Text("Back to Snackbar MainPage")
}
}.Center()
}.Padding(12));
Expand Down
Loading
Loading