Skip to content

Commit 11271f2

Browse files
authored
Merge branch 'main' into FixResourceMediaSource
2 parents 3063cf3 + 514b577 commit 11271f2

File tree

19 files changed

+355
-151
lines changed

19 files changed

+355
-151
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!

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
XC0618: Property, Property setter or BindableProperty "BackgroundColor" is deprecated
174174
IL2***: Trim Warnings
175175
IL3***: AOT Warnings
176-
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 -->
177178
<WarningsAsErrors>
178179
nullable,
179180
CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1587,CS1589,CS1590,CS1591,CS1592,CS1598,CS1658,CS1710,CS1711,CS1712,CS1723,CS1734,
@@ -198,7 +199,7 @@
198199
IL2110,IL2111,IL2112,IL2113,IL2114,IL2115,IL2116,IL2117,IL2118,IL2119,
199200
IL2120,IL2121,IL2122,
200201
IL3050,IL3051,IL3052,IL3053,IL3054,IL3055,IL3056,
201-
RS2007
202+
RS1038,RS2007
202203
</WarningsAsErrors>
203204

204205
<!--

samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ async void DisplayPopup(object sender, EventArgs e)
253253
ShouldAutoPlay = true,
254254
ShouldShowPlaybackControls = true,
255255
};
256-
256+
257257
await this.ShowPopupAsync(popupMediaElement);
258258
popupMediaElement.Stop();
259259
}

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupsPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ async void HandleSelfClosingPopupButtonClicked(object? sender, EventArgs e)
125125
{
126126
CanBeDismissedByTappingOutsideOfPopup = false
127127
});
128-
128+
129129
await Task.Delay(TimeSpan.FromSeconds(2));
130-
130+
131131
await this.ClosePopupAsync();
132132
}
133133
}

src/CommunityToolkit.Maui.Analyzers/CommunityToolkit.Maui.Analyzers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/CommunityToolkit.Maui.Camera.Analyzers/CommunityToolkit.Maui.Camera.Analyzers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/CommunityToolkit.Maui.MediaElement.Analyzers/CommunityToolkit.Maui.MediaElement.Analyzers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ void SetSystemBarsVisibility()
180180
}
181181
else
182182
{
183-
WindowCompat.SetDecorFitsSystemWindows(currentWindow, true);
184183
if (OperatingSystem.IsAndroidVersionAtLeast(30))
185184
{
186185
if (isSystemBarVisible)
@@ -195,6 +194,7 @@ void SetSystemBarsVisibility()
195194

196195
windowInsetsControllerCompat.Show(barTypes);
197196
windowInsetsControllerCompat.SystemBarsBehavior = WindowInsetsControllerCompat.BehaviorDefault;
197+
WindowCompat.SetDecorFitsSystemWindows(currentWindow, true);
198198
}
199199
}
200200

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.macios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static bool TryGetCurrentPage([NotNullWhen(true)] out Page? currentPage)
170170
}
171171

172172
// If not using Shell or a Modal Page, return the visible page in the (non-modal) NavigationStack
173-
if (window.Navigation.NavigationStack[^1] is Page page)
173+
if (window.Navigation.NavigationStack.LastOrDefault() is Page page)
174174
{
175175
currentPage = page;
176176
return true;

src/CommunityToolkit.Maui.SourceGenerators.Internal/CommunityToolkit.Maui.SourceGenerators.Internal.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" PrivateAssets="all" />
18+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
1919
</ItemGroup>
2020

2121
</Project>

0 commit comments

Comments
 (0)