.NET MAUI › Desktop - WinUI & Mac Catalyst
How do you access native Windows (WinUI) APIs from MAUI?
AdvancedAnswer
Guard code with #if WINDOWS and use the Windows App SDK/WinRT APIs, reaching the native control via Handler.PlatformView (a WinUI element). You can also add Windows-specific packages. Keep such code in Platforms/Windows or partial classes to isolate it.
#if WINDOWS
var native = (Microsoft.UI.Xaml.Controls.Button)button.Handler.PlatformView;
native.CornerRadius = new Microsoft.UI.Xaml.CornerRadius(12);
#endifReal-world example A Windows build applies a WinUI-specific corner radius by reaching the native button through its handler.