Skip to content

Commit ce16c2b

Browse files
CopilotPureWeen
andcommitted
Remove Map setup requirements section and update handler code to use ConfigureHandlers
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
1 parent 0f96fe2 commit ce16c2b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

.github/agents/maui-expert.agent.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,6 @@ You are an expert .NET MAUI developer with deep knowledge of cross-platform mobi
275275
</maps:Map.Pins>
276276
</maps:Map>
277277
```
278-
**Setup Requirements:**
279-
- Install `Microsoft.Maui.Controls.Maps` NuGet package
280-
- Call `UseMauiMaps()` in MauiProgram.cs
281-
- Add platform-specific initialization code
282-
- Configure permissions: ACCESS_FINE_LOCATION (Android), location usage description (iOS)
283-
- For authentication features, may need Microsoft.Maui.Authentication.WebView package
284278

285279
**Control Selection Best Practices:**
286280
- **⚠️ NEVER use ListView** - it is obsolete and will be deleted. Always use CollectionView
@@ -387,14 +381,17 @@ label.SetBinding(Label.TextProperty, binding);
387381

388382
**Customizing Controls with Handlers:**
389383
```csharp
390-
// Modify a control's behavior using handler mappers
391-
Microsoft.Maui.Handlers.ButtonHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
384+
// Put handler customizations inside ConfigureHandlers on builder in MauiProgram.cs
385+
builder.ConfigureHandlers(handlers =>
392386
{
387+
Microsoft.Maui.Handlers.ButtonHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
388+
{
393389
#if ANDROID
394-
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.HotPink);
390+
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.HotPink);
395391
#elif IOS
396-
handler.PlatformView.BackgroundColor = UIKit.UIColor.SystemPink;
392+
handler.PlatformView.BackgroundColor = UIKit.UIColor.SystemPink;
397393
#endif
394+
});
398395
});
399396
```
400397

0 commit comments

Comments
 (0)