HtmlLabelPlugin icon indicating copy to clipboard operation
HtmlLabelPlugin copied to clipboard

Move the library over to MAUI.

Open bakerhillpins opened this issue 2 years ago • 9 comments

In response to #134 I thought I'd convert this library as a way to learn MAUI and see what work lies ahead for me in other project space.

Using MAUI Compatibility I've compiled the library under VS2022 17.2.0 Preview 6.0 for MAUI and included an example app that's modeled after the current. Android works, Windows works but doesn't display lists (?), Mac/Tizen are not implemented, and iOS throws an InvalidCastException in the depths of MAUI code. It's a start.

I've set the PR to go into DEV, seemed like the proper target.

I've done NO work on the pipelines to support this. I don't even think I'd have access to them anyway.

At some point, possibly soon, I'm going to try to convert the Renders over to the MAUI format of Handlers/Mappers (or whatever they are called) so that I can understand that process. I'll probably just commit that in this PR.

bakerhillpins avatar May 06 '22 19:05 bakerhillpins

@bakerhillpins That seems great! I am not up to date with the latest Xamarin developments so it's hard for me to validate anything really. But I will try to learn more as it seems the way forward. Time to buy a mac again maybe

matteobortolazzo avatar May 12 '22 19:05 matteobortolazzo

@matteobortolazzo Current update moves to the new MAUI based control/handlers format. I'm going to just keep pushing my work to this branch as I'm trying to use this as a way to learn MAUI. Lots to do still but I've at least got it rendering text on Android/Windows with VS2022 17.3.0 Preview 1. See commit a5acc9a comment above for the full info on what's done.

If someone wants to run with the Compatibility implementation they can branch off of commit c30cd5d above.

bakerhillpins avatar May 13 '22 19:05 bakerhillpins

@matteobortolazzo - I've moved the project to a file/project format that the MAUI team appears to suggest in their examples. In doing so I've changed the Namespaces and other Package name elements. I've moved from the Xam/Plugin/Forms names to Maui and removed the root namespace HtmlLabel because I got annoyed with how it interfered with intellisense when coding.

The Root namespace choice HyperTextLabel is arbitrary to move me forward. I'd like you to review and make the appropriate selections of namespaces/package names so that you are happy and that it will appear on nuget.org as you'd like.

Thanks,

bakerhillpins avatar May 25 '22 12:05 bakerhillpins

@matteobortolazzo Still have plans to work on this. Need to finish moving some other code over to MAUI first.

bakerhillpins avatar Jun 13 '22 19:06 bakerhillpins

Sure, thanks for the effort you are putting into it!! I will not merge until you are happy. About the namespace, I need to think about it when I focus on this project

matteobortolazzo avatar Jun 13 '22 21:06 matteobortolazzo

@bakerhillpins How are things going on this heroic endeavor? I don't mind helping to test things out when you're at a good stopping point!

somoreingold avatar Mar 24 '23 15:03 somoreingold

@bakerhillpins How are things going on this heroic endeavor? I don't mind helping to test things out when you're at a good stopping point!

Honestly, It got bogged down in dealing with the handlers for each property (resulting in lots of situations where formatting code was re-executed) and other work that I haven't touched it in quite some time.

TBH, you should probably look into Blazor Hybrid as if I understand correctly you could just inject the HTML directly into a razor page and let it deal with it without the differences between platforms. That's the direction I'm currently leaning but don't have the bandwidth to try just yet.

bakerhillpins avatar Apr 20 '23 13:04 bakerhillpins

@bakerhillpins That's an interesting alternative. I've started looking into this as well. One challenge I'm seeing is the ability to have the HTML be dynamic (i.e. a string of HTML consumed/parsed at runtime). All the examples of the Blazor Hybrid solution seem to just be HTML as part of the page already. If you have any ideas, I'm all ears!

somoreingold avatar Apr 27 '23 14:04 somoreingold

@somoreingold I believe you simply need to use binding operations to bind to the html string.

bakerhillpins avatar Apr 28 '23 11:04 bakerhillpins