Skip to content

Commit 3db7350

Browse files
Port Xamarin samples to .NET MAUI (dotnet#2929)
* Port Xamarin samples to .NET MAUI Fixes: dotnet#2910 Copilot was able to automate much of this. I got "nerd sniped" to fix some of the issues I found along the way. There are some fixes required for iOS and Android to work, I will send in separate PRs. * `dotnet sln migrate BenchmarkDotNet.Maui.sln`
1 parent 848196a commit 3db7350

File tree

93 files changed

+1067
-920
lines changed

Some content is hidden

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

93 files changed

+1067
-920
lines changed

BenchmarkDotNet.Maui.slnx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Solution>
2+
<Configurations>
3+
<Platform Name="Any CPU" />
4+
<Platform Name="x64" />
5+
<Platform Name="x86" />
6+
</Configurations>
7+
<Folder Name="/samples/">
8+
<Project Path="samples/BenchmarkDotNet.Samples.Maui/BenchmarkDotNet.Samples.Maui.csproj" />
9+
</Folder>
10+
<Folder Name="/src/">
11+
<Project Path="src/BenchmarkDotNet.Annotations/BenchmarkDotNet.Annotations.csproj" />
12+
<Project Path="src/BenchmarkDotNet/BenchmarkDotNet.csproj" />
13+
</Folder>
14+
</Solution>

BenchmarkDotNet.Xamarin.sln

Lines changed: 0 additions & 125 deletions
This file was deleted.

docs/_redirects/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@
4545
/Configs/Loggers.htm /articles/configs/loggers.html
4646
/Configs/Validators.htm /articles/configs/validators.html
4747
/Configs/Jobs.htm /articles/configs/jobs.html
48+
/articles/samples/IntroXamarin.html /articles/samples/IntroMaui.html

docs/articles/samples/IntroMaui.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
uid: BenchmarkDotNet.Samples.Maui
3+
---
4+
5+
## Sample: IntroMaui
6+
7+
To use BenchmarkDotNet with [.NET MAUI](https://dotnet.microsoft.com/apps/maui), you will need to build a small UI for running benchmarks and displaying the results.
8+
9+
.NET MAUI allows you to run your benchmarks on Android, iOS, Mac Catalyst, and Windows from a single codebase.
10+
11+
Other notes:
12+
13+
* Use `Release` builds when running actual benchmarks.
14+
* Consider disabling trimming appropriately for your benchmarks.
15+
16+
### Source code
17+
18+
[!code-csharp[MainPage.xaml.cs](../../../samples/BenchmarkDotNet.Samples.Maui/MainPage.xaml.cs)]
19+
20+
### Output
21+
22+
#### Windows
23+
24+
![MAUI Output - Windows](../../images/maui-screenshot-windows.png)
25+
26+
#### Android
27+
28+
![MAUI Output - Android](../../images/maui-screenshot-android.png)
29+
30+
#### iOS
31+
32+
![MAUI Output - iOS](../../images/maui-screenshot-ios.png)
33+
34+
#### Mac Catalyst
35+
36+
![MAUI Output - mac](../../images/maui-screenshot-mac.png)
37+
38+
### Links
39+
40+
* [.NET MAUI Documentation](https://learn.microsoft.com/dotnet/maui/)
41+
* [Trimming in .NET MAUI](https://learn.microsoft.com/dotnet/maui/deployment/trimming)
42+
* The permanent link to this sample: @BenchmarkDotNet.Samples.Maui
43+
44+
---

docs/articles/samples/IntroXamarin.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/articles/samples/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,5 @@
132132
href: IntroWasm.md
133133
- name: IntroUnicode
134134
href: IntroUnicode.md
135-
- name: IntroXamarin
136-
href: IntroXamarin.md
135+
- name: IntroMaui
136+
href: IntroMaui.md
71.5 KB
Loading
122 KB
Loading
47.3 KB
Loading
15.5 KB
Loading

0 commit comments

Comments
 (0)