

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456789101112# Threading and Async Patterns1314## UI Thread Dispatch15- Platform view modifications MUST happen on the UI thread16- **Android**: `platformView.Post(() => { })` or `Looper.MainLooper` for thread checks17- **iOS/MacCatalyst**: `MainThread.BeginInvokeOnMainThread()` or `DispatchQueue.MainQueue`18- **Windows**: `DispatcherQueue.TryEnqueue()` — be aware of COM threading apartment model1920## Async Handler Operations21- Use `.FireAndForget(handler)` for async work in mapper methods — never bare `async void`22- After `await`, verify the handler is still connected (`VirtualView != null`) before applying results23- Thread `CancellationToken` through long-running operations and check at appropriate yield points2425## Race Condition Prevention26- Concurrent access to shared state must use `lock`, `Interlocked`, or immutable patterns27- Image loading and other async pipelines must cancel in-flight operations when the source changes28- Guard against stale callbacks — platform callbacks may fire after `DisconnectHandler`2930## Platform-Specific Patterns31- **Android**: API-level checks use `Build.VERSION.SdkInt` comparison, not version string parsing32- **iOS**: Use `System.OperatingSystem.IsIOSVersionAtLeast()` for linker-friendly runtime checks33- **Windows**: WinUI version checks may be needed for features in specific Windows App SDK versions34- Use `System.OperatingSystem` APIs over `RuntimeInformation` — they are trimmer/AOT-friendly35
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotnet/maui.github/instructions/public-api.instructions.md · 23k | Copilot instructions | apido-not | 59/100 | 9 days ago | |
| dotnet/maui.github/copilot-instructions.md · 23k | Copilot instructions | setuptestlint-formatstyle+6 | 76/100 | 14 days ago | |
| dotnet/maui.github/instructions/android.instructions.md · 23k | Copilot instructions | buildstyle | 70/100 | 14 days ago | |
| dotnet/maui.github/instructions/ci-copilot-pipeline-security.instructions.md · 23k | Copilot instructions | gitsecuritydeploymentdo-not+1 | 76/100 | 14 days ago | |
| dotnet/maui.github/instructions/collectionview-android.instructions.md · 23k | Copilot instructions | stylearchperformanceagent-behaviour | 52/100 | 14 days ago | |
| dotnet/maui.github/instructions/collectionview-handler-detection.instructions.md · 23k | Copilot instructions | stylegitdo-not | 73/100 | 14 days ago | |
| dotnet/maui.github/instructions/collectionview-ios.instructions.md · 23k | Copilot instructions | styleperformance | 48/100 | 14 days ago | |
| dotnet/maui.github/instructions/collectionview-windows.instructions.md · 23k | Copilot instructions | stylearch | 52/100 | 14 days ago | |
| dotnet/maui.github/instructions/handler-patterns.instructions.md · 23k | Copilot instructions | styledo-not | 55/100 | 14 days ago | |
| dotnet/maui.github/instructions/helix-device-tests.instructions.md · 23k | Copilot instructions | setupbuildtestarch | 74/100 | 14 days ago | |
| dotnet/maui.github/instructions/integration-tests.instructions.md · 23k | Copilot instructions | setupteststyledo-not | 92/100 | 14 days ago | |
| dotnet/maui.github/instructions/layout-system.instructions.md · 23k | Copilot instructions | archapiperformancedo-not | 55/100 | 14 days ago | |
| dotnet/maui.github/instructions/performance-hotpaths.instructions.md · 23k | Copilot instructions | styleperformancedo-not | 55/100 | 14 days ago | |
| dotnet/maui.github/instructions/sandbox.instructions.md · 23k | Copilot instructions | buildteststyletesting-strategy+4 | 81/100 | 14 days ago | |
| dotnet/maui.github/instructions/templates.instructions.md · 23k | Copilot instructions | buildteststylearch+1 | 92/100 | 14 days ago | |
| dotnet/maui.github/instructions/xaml-unittests.instructions.md · 23k | Copilot instructions | teststyledocs | 70/100 | 14 days ago | |
| dotnet/maui.github/instructions/safe-area-ios.instructions.md · 23k | Copilot instructions | stylegit | 43/100 | 14 days ago | |
| dotnet/maui.github/instructions/uitests.instructions.md · 23k | Copilot instructions | setupbuildteststyle+5 | 79/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | today | |
| ardalis/CleanArchitecture.github/copilot-instructions.md · 18k | Copilot instructions | buildteststylearch+4 | 96/100 | 14 days ago | |
| dotnet/maui.github/instructions/templates.instructions.md · 23k | Copilot instructions | buildteststylearch+1 | 92/100 | 14 days ago | |
| dotnet/maui.github/instructions/integration-tests.instructions.md · 23k | Copilot instructions | setupteststyledo-not | 92/100 | 14 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 89/100 | 8 days ago | |
| we-promise/sure.github/copilot-instructions.md · 9.5k | Copilot instructions | setuptestlint-formatstyle+10 | 88/100 | 13 days ago | |
| microsoft/WSL.github/copilot-instructions.md · 33k | Copilot instructions | setupbuildtestlint-format+7 | 88/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/start-native-execution.instructions.md · 55k | Copilot instructions | buildstylearchgit+1 | 86/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/dotnet-maui-github-instructions-threading-async-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.