I don t really understand Maui handlers using Partial class method. When using other method you have options like AppendToMapping
that you can extend the current mapping but when I use partial classes, I get a new instance of the control always. I am not able to append the existing control. That means if i define a control that inherits from Maui control with some default values and registering this control with platforms specific handlers, my control loses predefined cross platform values. This is not the way Renderers are working xamarin.forms?
So what is this case and how to fix this?
Please dont suggest me to use Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping
because this does not exist in maui class library if i want to work with nuget packages.
Even Microsoft s documentation doesn t mention about partial classes to customize a control but mentions here Create a control. (yes there is something at the end with Partial class but this is totally irrelevant, not sure what is this about and MS documented something like that) Why? If that is not possible, thats a huge downgrade in Maui from Xamarin.forms.
UPDATE:
I have created a test repo with demo maui project and maui class library.
https://github.com/EmilAlipiev/TestMauiHandlers
under the class library you find the Old renderers under each platform and new upgraded Handlers under handlers folders.
- So first run the Demo project in IOS without handlers. you can see the default value for text "this is default text" on the ui.
- enable ConfigureMauiHandler in MauiProgram.cs in HandlersDemoApp
- You see that default text is empty
Reason for that is Handlers are creating a complete new Entry instead of extending the Entry defined in the shared part i believe.
If i use renderers they will be just extended with the default cross platform definitions.
last question; I have this CustomEntry in the Class library because i want to created a nuget package. How do i register handlers within the class library?