Skip to content

Commit 0807479

Browse files
Merge branch 'main' into tint-navigate-bug
2 parents 519c024 + 8f41526 commit 0807479

File tree

187 files changed

+5649
-3106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+5649
-3106
lines changed

.github/copilot-instructions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
This document provides guidelines for using GitHub Copilot to contribute to the .NET MAUI Community Toolkit. It includes instructions on setting up your environment, writing code, and following best practices specific to .NET MAUI.
33

44
## Prerequisites
5-
1. Install the latest stable (.NET SDK)[https://dotnet.microsoft.com/en-us/download].
5+
1. Install the latest stable [.NET SDK](https://dotnet.microsoft.com/en-us/download).
66
2. Install .NET MAUI workloads (we recommend using Visual Studio installer).
77

88
## Setting Up GitHub Copilot
99
1. Ensure you have GitHub Copilot installed and enabled in Visual Studio.
10-
2. Familiarize yourself with the basic usage of GitHub Copilot by reviewing the (official documentation)[https://docs.github.com/en/copilot].
10+
2. Familiarize yourself with the basic usage of GitHub Copilot by reviewing the [official documentation](https://docs.github.com/en/copilot).
1111

1212
## Writing Code with GitHub Copilot
1313
### General Guidelines
@@ -17,15 +17,15 @@ This document provides guidelines for using GitHub Copilot to contribute to the
1717
### Specific to .NET MAUI
1818
* Ensure that any UI components or controls are compatible with .NET MAUI.
1919
* Avoid using Xamarin.Forms-specific code unless there is a direct .NET MAUI equivalent.
20-
* Follow the project's coding style and best practices as outlined in the (contributing)[https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md] document.
20+
* Follow the project's coding style and best practices as outlined in the [contributing](https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md) document.
2121

2222
## Best Practices
2323
* Use **Trace.WriteLine()** for debug logging instead of **Debug.WriteLine()**.
2424
* Include a **CancellationToken** as a parameter for methods returning **Task** or **ValueTask**.
2525
* Use **is** for null checking and type checking.
2626
* Use file-scoped namespaces to reduce code verbosity.
2727
* Avoid using the **!** null forgiving operator.
28-
** Follow naming conventions for enums and property names.
28+
* Follow naming conventions for enums and property names.
2929

3030
### Debug Logging
3131
* Always use `Trace.WriteLine()` instead of `Debug.WriteLine` for debug logging because `Debug.WriteLine` is removed by the compiler in Release builds
@@ -141,7 +141,7 @@ Read and follow our [Pull Request template](https://github.com/CommunityToolkit/
141141
4. Open a pull request and follow the [Pull Request template](https://github.com/CommunityToolkit/Maui/blob/main/.github/PULL_REQUEST_TEMPLATE.md).
142142

143143
## Additional Resources
144-
- (GitHub Copilot Documentation)[https://docs.github.com/en/copilot]
145-
- (.NET MAUI Documentation)[https://learn.microsoft.com/en-us/dotnet/maui/]
144+
* [GitHub Copilot Documentation](https://docs.github.com/en/copilot)
145+
* [.NET MAUI Documentation](https://learn.microsoft.com/en-us/dotnet/maui/)
146146

147-
By following these guidelines, you can effectively use GitHub Copilot to contribute to the .NET MAUI Community Toolkit. Thank you for your contributions!
147+
By following these guidelines, you can effectively use GitHub Copilot to contribute to the .NET MAUI Community Toolkit. Thank you for your contributions!

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ updates:
2424
- dependency-name: "Xamarin.AndroidX.Collection"
2525
- dependency-name: "Xamarin.AndroidX.Lifecycle.LiveData"
2626
- dependency-name: "Xamarin.AndroidX.Collection.Ktx"
27+
- package-ecosystem: "github-actions"
28+
directory: "/"
29+
schedule:
30+
interval: "weekly"

.github/workflows/dotnet-build.yml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
NugetPackageVersionCamera: '99.0.0-preview${{ github.run_number }}'
2323
NugetPackageVersionMediaElement: '99.0.0-preview${{ github.run_number }}'
2424
NugetPackageVersionMaps: '99.0.0-preview${{ github.run_number }}'
25-
TOOLKIT_NET_VERSION: '9.0.202'
25+
TOOLKIT_NET_VERSION: '9.0.300'
2626
LATEST_NET_VERSION: '9.0.x'
2727
PathToLibrarySolution: 'src/CommunityToolkit.Maui.sln'
2828
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Sample.sln'
@@ -59,7 +59,7 @@ jobs:
5959
os: [windows-latest, macos-15]
6060
steps:
6161
- name: Checkout code
62-
uses: actions/checkout@main
62+
uses: actions/checkout@v4
6363

6464
- name: Set Latest Xcode Version
6565
if: runner.os == 'macOS'
@@ -104,28 +104,33 @@ jobs:
104104
os: [windows-latest, macos-15]
105105
steps:
106106
- name: Checkout code
107-
uses: actions/checkout@main
107+
uses: actions/checkout@v4
108108

109109
- name: Set NuGet Version to Tag Number
110-
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-mediaelement')
111-
run: echo "NugetPackageVersion=${{ github.ref }}" >> $GITHUB_ENV
110+
if: startsWith(github.ref, 'refs/tags/') && (!endsWith(github.ref, '-mediaelement') && !endsWith(github.ref, '-camera') && !endsWith(github.ref, '-maps'))
111+
run: echo "NugetPackageVersion=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
112+
shell: bash
112113

113114
- name: Set NuGet Version to Tag Number for Camera
114115
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-camera')
115-
run: echo "NugetPackageVersionCamera=${{ github.ref }}" >> $GITHUB_ENV
116+
run: echo "NugetPackageVersionCamera=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
117+
shell: bash
116118

117119
- name: Set NuGet Version to Tag Number for MediaElement
118120
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-mediaelement')
119-
run: echo "NugetPackageVersionMediaElement=${{ github.ref }}" >> $GITHUB_ENV
121+
run: echo "NugetPackageVersionMediaElement=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
122+
shell: bash
120123

121124
- name: Set NuGet Version to Tag Number for Maps
122125
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-maps')
123-
run: echo "NugetPackageVersionMaps=${{ github.ref }}" >> $GITHUB_ENV
126+
run: echo "NugetPackageVersionMaps=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
127+
shell: bash
124128

125129
- name: Set NuGet Version to PR Version
126130
if: ${{ github.event_name == 'pull_request' }}
127131
run: |
128132
echo "NugetPackageVersion=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
133+
echo "NugetPackageVersionCamera=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
129134
echo "NugetPackageVersionMediaElement=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
130135
echo "NugetPackageVersionMaps=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
131136
shell: bash
@@ -258,7 +263,7 @@ jobs:
258263

259264
sign:
260265
needs: [build_library]
261-
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') }}
266+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
262267
runs-on: windows-latest
263268
permissions:
264269
id-token: write # Required for requesting the JWT
@@ -281,6 +286,27 @@ jobs:
281286
with:
282287
name: packages
283288
path: ./packages
289+
290+
- name: Remove MediaElement package if that is not being released
291+
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-mediaelement')
292+
run: |
293+
${{ github.workspace }}/packages/**/*.nupkg | Where-Object { $_ -notmatch "CommunityToolkit.Maui.MediaElement" } | Remove-Item -Force
294+
295+
- name: Remove Camera package if that is not being released
296+
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-camera')
297+
run: |
298+
${{ github.workspace }}/packages/**/*.nupkg | Where-Object { $_ -notmatch "CommunityToolkit.Maui.Camera" } | Remove-Item -Force
299+
300+
- name: Remove Maps package if that is not being released
301+
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-maps')
302+
run: |
303+
${{ github.workspace }}/packages/**/*.nupkg | Where-Object { $_ -notmatch "CommunityToolkit.Maui.Maps" } | Remove-Item -Force
304+
305+
- name: Remove Core & Main package if that is not being released
306+
if: startsWith(github.ref, 'refs/tags/') && (!endsWith(github.ref, '-mediaelement') && !endsWith(github.ref, '-camera') && !endsWith(github.ref, '-maps'))
307+
run: |
308+
${{ github.workspace }}/packages/**/*.nupkg | Where-Object { $_ -notmatch "CommunityToolkit.Maui" } | Remove-Item -Force
309+
${{ github.workspace }}/packages/**/*.nupkg | Where-Object { $_ -notmatch "CommunityToolkit.Maui.Core" } | Remove-Item -Force
284310
285311
- name: Install Signing Tool
286312
run: dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
@@ -293,7 +319,7 @@ jobs:
293319
--file-list "${{ github.workspace }}/SignClientFileList.txt"
294320
--timestamp-url "http://timestamp.digicert.com"
295321
--publisher-name ".NET Foundation"
296-
--description "Community Toolkit MAUI"
322+
--description ".NET MAUI Community Toolkit"
297323
--description-url "https://github.com/CommunityToolkit/Maui"
298324
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
299325
--azure-key-vault-client-id ${{ secrets.SIGN_CLIENT_ID }}
@@ -311,7 +337,7 @@ jobs:
311337
${{ github.workspace }}/packages/**/*.nupkg
312338
313339
release:
314-
if: ${{ startsWith(github.ref, 'refs/heads/rel/') }}
340+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
315341
needs: [sign]
316342
environment: nuget-release-gate # This gates this job until manually approved
317343
runs-on: ubuntu-latest

.github/workflows/dotnet-format-daily.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
run: dotnet tool install -g dotnet-format
1111

1212
- name: Checkout repo
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
ref: ${{ github.head_ref }}
1616

1717
- name: Run dotnet format
1818
id: format
19-
uses: jfversluis/dotnet-format@v1.0.5
19+
uses: jfversluis/dotnet-format@v1.0.9
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
action: "fix"
@@ -31,7 +31,7 @@ jobs:
3131
git commit -a -m 'Automated dotnet-format update'
3232
3333
- name: Create Pull Request
34-
uses: peter-evans/create-pull-request@v3
34+
uses: peter-evans/create-pull-request@v7
3535
with:
3636
title: '[housekeeping] Automated PR to fix formatting errors'
3737
body: |

Directory.Build.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<NuGetAuditMode>all</NuGetAuditMode>
1717

1818
<!-- MAUI Specific -->
19-
<MauiPackageVersion>9.0.60</MauiPackageVersion>
19+
<MauiPackageVersion>9.0.70</MauiPackageVersion>
2020
<NextMauiPackageVersion>10.0.0</NextMauiPackageVersion>
2121
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
2222
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
@@ -170,9 +170,11 @@
170170
xUnit3002: Classes which are JSON serializable should not be tested for their concrete type
171171
XC0045: Binding: Property not found
172172
XC0103: Consider attributing the markup extension with [RequireService] or [AcceptEmptyServiceProvider] if it doesn't require any
173+
XC0618: Property, Property setter or BindableProperty "BackgroundColor" is deprecated
173174
IL2***: Trim Warnings
174175
IL3***: AOT Warnings
175-
RS2007: Analyzer release file 'AnalyzerReleases.Shipped.md' has a missing or invalid release header-->
176+
RS1038: Compiler extensions should be implemented in assemblies with compiler-provided references
177+
RS2007: Analyzer release file 'AnalyzerReleases.Shipped.md' has a missing or invalid release header -->
176178
<WarningsAsErrors>
177179
nullable,
178180
CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1587,CS1589,CS1590,CS1591,CS1592,CS1598,CS1658,CS1710,CS1711,CS1712,CS1723,CS1734,
@@ -182,7 +184,7 @@
182184
xUnit1000,xUnit1001,xUnit1002,xUnit1003,xUnit1004,xUnit1005,xUnit1006,xUnit1007,xUnit1008,xUnit1009,xUnit1010,xUnit1011,xUnit1012,xUnit1013,xUnit1014,xUnit1015,xUnit1016,xUnit1017,xUnit1018,xUnit1019,xUnit1020,xUnit1021,xUnit1022,xUnit1023,xUnit1024,xUnit1025,xUnit1026,xUnit1027,xUnit1028,xUnit1029,xUnit1030,xUnit1031,xUnit1032,xUnit1033,xUnit1034,xUnit1035,xUnit1036,xUnit1037,xUnit1038,xUnit1039,xUnit1040,xUnit1041,xUnit1042,xUnit1043,xUnit1048,xUnit1049,xUnit1050,xUnit1051,
183185
xUnit2000,xUnit2001,xUnit2002,xUnit2003,xUnit2004,xUnit2005,xUnit2006,xUnit2007,xUnit2008,xUnit2009,xUnit2010,xUnit2011,xUnit2012,xUnit2013,xUnit2014,xUnit2015,xUnit2016,xUnit2017,xUnit2018,xUnit2019,xUnit2020,xUnit2021,xUnit2022,xUnit2023,xUnit2024,xUnit2025,xUnit2026,xUnit2027,xUnit2028,xUnit2029,xUnit2030,xUnit2031,xUnit2032,
184186
xUnit3000,xUnit3001,xUnit3002,
185-
XC0045,XC0103,
187+
XC0045,XC0103,XC0618,
186188
IL2001,IL2002,IL2003,IL2004,IL2005,IL2006,IL2007,IL2008,IL2009,
187189
IL2010,IL2011,IL2012,IL2013,IL2014,IL2015,IL2016,IL2017,IL2018,IL2019,
188190
IL2020,IL2021,IL2022,IL2023,IL2024,IL2025,IL2026,IL2027,IL2028,IL2029,
@@ -197,7 +199,7 @@
197199
IL2110,IL2111,IL2112,IL2113,IL2114,IL2115,IL2116,IL2117,IL2118,IL2119,
198200
IL2120,IL2121,IL2122,
199201
IL3050,IL3051,IL3052,IL3053,IL3054,IL3055,IL3056,
200-
RS2007
202+
RS1038,RS2007
201203
</WarningsAsErrors>
202204

203205
<!--

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<img src="https://user-images.githubusercontent.com/13558917/137551073-ac8958bf-83e3-4ae3-8623-4db6dce49d02.png" alt="..NET Bot" width=125> [<img src="https://raw.githubusercontent.com/dotnet-foundation/swag/master/logo/dotnetfoundation_v4.svg" alt=".NET Foundation" width=100>](https://dotnetfoundation.org)
22

3-
[![Build Status](https://dev.azure.com/dotnet/CommunityToolkit/_apis/build/status/CommunityToolkit.Maui?branchName=main)](https://dev.azure.com/dotnet/CommunityToolkit/_build/latest?definitionId=169&branchName=main) [![NuGet Version](https://img.shields.io/nuget/vpre/CommunityToolkit.Maui)](https://www.nuget.org/packages/CommunityToolkit.Maui) [![NuGet Downloads](https://img.shields.io/nuget/dt/CommunityToolkit.Maui)](https://www.nuget.org/packages/CommunityToolkit.Maui)
3+
[![Build](https://github.com/CommunityToolkit/Maui/actions/workflows/dotnet-build.yml/badge.svg)](https://github.com/CommunityToolkit/Maui/actions/workflows/dotnet-build.yml) [![NuGet Downloads](https://img.shields.io/nuget/dt/CommunityToolkit.Maui)](https://www.nuget.org/packages/CommunityToolkit.Maui)
44

55
# .NET MAUI Community Toolkit
66

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.202",
3+
"version": "9.0.300",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

samples/CommunityToolkit.Maui.Sample/App.xaml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,34 @@
1010
</ResourceDictionary.MergedDictionaries>
1111

1212
<Style TargetType="{x:Type popups:ImplicitStylePopup}">
13-
<Setter Property="Size" Value="100,100" />
14-
<Setter Property="Color" Value="Red" />
15-
<Setter Property="HorizontalOptions" Value="Start" />
16-
<Setter Property="VerticalOptions" Value="Start" />
17-
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
13+
<Setter Property="WidthRequest" Value="100" />
14+
<Setter Property="HeightRequest" Value="100" />
15+
<Setter Property="BackgroundColor" Value="Red" />
1816
</Style>
1917

2018
<Style x:Key="ExplicitPopupStyle" TargetType="{x:Type popups:ExplicitStylePopup}">
21-
<Setter Property="Size" Value="200,100" />
22-
<Setter Property="Color" Value="Yellow" />
23-
<Setter Property="HorizontalOptions" Value="End" />
24-
<Setter Property="VerticalOptions" Value="Start" />
25-
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
19+
<Setter Property="WidthRequest" Value="200" />
20+
<Setter Property="HeightRequest" Value="100" />
21+
<Setter Property="BackgroundColor" Value="Yellow" />
2622
</Style>
2723

2824
<Style x:Key="BasePopupStyle" TargetType="{x:Type popups:StyleInheritancePopup}">
29-
<Setter Property="Size" Value="200,200" />
25+
<Setter Property="WidthRequest" Value="200" />
26+
<Setter Property="HeightRequest" Value="200" />
3027
</Style>
3128
<Style x:Key="InheritancePopupStyle" TargetType="{x:Type popups:StyleInheritancePopup}" BasedOn="{StaticResource BasePopupStyle}">
32-
<Setter Property="Color" Value="SkyBlue" />
33-
<Setter Property="HorizontalOptions" Value="End" />
34-
<Setter Property="VerticalOptions" Value="End" />
35-
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
29+
<Setter Property="BackgroundColor" Value="SkyBlue" />
3630
</Style>
3731

3832
<Style x:Key="DynamicBasePopupStyle" TargetType="{x:Type popups:DynamicStyleInheritancePopup}">
39-
<Setter Property="Size" Value="150,150" />
33+
<Setter Property="WidthRequest" Value="150" />
34+
<Setter Property="HeightRequest" Value="150" />
4035
</Style>
4136
<Style x:Key="DynamicInheritancePopupStyle1" TargetType="{x:Type popups:DynamicStyleInheritancePopup}" BasedOn="{StaticResource DynamicBasePopupStyle}">
42-
<Setter Property="Color" Value="Purple" />
43-
<Setter Property="VerticalOptions" Value="End" />
37+
<Setter Property="BackgroundColor" Value="Purple" />
4438
</Style>
4539
<Style x:Key="DynamicInheritancePopupStyle2" TargetType="{x:Type popups:DynamicStyleInheritancePopup}" BaseResourceKey="DynamicInheritancePopupStyle1">
46-
<Setter Property="Color" Value="Orange" />
47-
<Setter Property="HorizontalOptions" Value="End" />
48-
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
40+
<Setter Property="BackgroundColor" Value="Orange" />
4941
</Style>
5042

5143
</ResourceDictionary>

0 commit comments

Comments
 (0)