How to create Custom Handlers (wiki documentation incorrect) #20929
Unanswered
headintheclouds21
asked this question in
General
Replies: 1 comment 4 replies
-
Have you reviewed the Learn documentation on this? That page is old. I'll make sure it links to these docs. https://learn.microsoft.com/en-us/dotnet/maui/migration/renderer-to-handler?view=net-maui-8.0 I have a few handlers here that might be a good reference https://github.com/davidortinau/SmartHotel360-Mobile/tree/main/Source/SmartHotel.Clients/SmartHotel.Clients |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been recently trying to create custom handlers in NET MAUI and I came across this page on the wiki. https://github.com/dotnet/maui/wiki/Porting-Custom-Renderers-to-Handlers#net-maui-handlers I've tried implmenting this, but was unsuccessful. I've noticed that some of the code appears to be incorrect and prevents the example from building.
For example, this line in the wiki, 'collection' should be replaced with 'handlers'
builder.ConfigureMauiHandlers(collection =>
{
//#if __ANDROID__
handlers.AddHandler(typeof(CustomEntry), typeof(CustomEntryHandler));
//#endif
});
This leads me to believe there are other syntax issues too could be preventing it from working as expected, Does anyone know the correct way to create the custom handler in the example. The example is for an Android EditText. I'd like to create one that control as well as other android controls. If i can get a working example to help me understand how this works, I can build off that knowledge. Seeing a complete example would be very helpful. I've already read through the MAUI docs. Any advice is greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions