.NET MAUI › Platform Integration & Handlers
How do you customize a control on a single platform using a handler?
IntermediateAnswer
Use PropertyMapper customization scoped by checking the view instance, or subclass the handler for that control and register it. AppendToMapping adds behavior after the default; ModifyMapping replaces a specific property's mapping. Guard native calls with platform #if.
#if IOS
Microsoft.Maui.Handlers.SwitchHandler.Mapper.AppendToMapping(
"Tint", (h, v) => h.PlatformView.OnTintColor =
UIKit.UIColor.SystemGreenColor);
#endifReal-world example Product design wants iOS switches tinted brand-green; a single iOS-guarded mapper achieves it without touching Android.