How to disable borders and underlining of Entry on Windows .NET MAUI?
16:03 02 Apr 2023

I am trying to customize an Entry in MAUI. The main aim is to disable borders and underlining. This is my current code in MauiProgram.cs file:

Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping(nameof(MdeEntry), (handler, view) =>
        {
#if ANDROID
            handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
#elif WINDOWS
            //handler.PlatformView.Background = Colors.Transparent.ToPlatform();
            //handler.PlatformView.BorderThickness = new Microsoft.UI.Xaml.Thickness(0);
            //handler.PlatformView.GotFocus += (s, e) =>
            //{
            //    handler.PlatformView.Background = new Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.Transparent);
            //    handler.PlatformView.BorderThickness = new Microsoft.UI.Xaml.Thickness(0);
            //    handler.PlatformView.BorderBrush = new Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.Red);
            //};
#endif
        });

As you see, commented code - is my attemts to solve my issue and all of this code for Windows is not working. But, this one for Android is working as I want:

#if ANDROID
            handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);

Does someone know how to disable borders and underlining of Entry on Windows?

c# windows maui