diff --git a/AdventureWorks.MAUI/MauiProgram.cs b/AdventureWorks.MAUI/MauiProgram.cs index 22c06e3..6658fcd 100644 --- a/AdventureWorks.MAUI/MauiProgram.cs +++ b/AdventureWorks.MAUI/MauiProgram.cs @@ -21,6 +21,7 @@ namespace AdventureWorks.MAUI #if WINDOWS SetWindowOptions(builder); + SetWindowHandlers(); #endif #if DEBUG @@ -53,5 +54,20 @@ namespace AdventureWorks.MAUI }); } #endif +#if WINDOWS + public static void SetWindowHandlers() + { + // Customize the Switch control for Windows + Microsoft.Maui.Handlers.SwitchHandler.Mapper + .AppendToMapping("Custom", (h,v) => + { + h.PlatformView.OffContent = "No"; + h.PlatformView.OnContent = "Yes"; + + h.PlatformView.MinWidth = 0; + }); + } +#endif + } } diff --git a/AdventureWorks.MAUI/Views/UserDetailView.xaml b/AdventureWorks.MAUI/Views/UserDetailView.xaml index d2affd9..084a753 100644 --- a/AdventureWorks.MAUI/Views/UserDetailView.xaml +++ b/AdventureWorks.MAUI/Views/UserDetailView.xaml @@ -7,7 +7,7 @@ - @@ -66,10 +66,31 @@ - + +