BlazorWebFormsComponents icon indicating copy to clipboard operation
BlazorWebFormsComponents copied to clipboard

Custom Control shim?

Open csharpfritz opened this issue 5 years ago • 4 comments

When we consider converting usercontrols, master pages, and pages we also need to consider converting custom controls.

Is there a shim abstract class that we could make available that these classes that inherit from WebControl or CompositeControl could inherit from and be able to work with Blazor?

I think this may be a separate .NET Standard class library to support this goal

csharpfritz avatar Feb 17 '20 20:02 csharpfritz

I've recently been working on a project that needed this. I'd like to take a look at what would be possible here. Some of the issues I've seen:

  • [ ] Need an HtmlTextWriter
  • [x] Support for ControlCollection
  • [x] FindControl(string id)

That's the order of importance I've seen. I've got a simple custom control working that takes in an HtmlTextWriter and writes out content via the RenderTreeBuilder; I can look at what the WebControl or CompositeControl looks like. I'm happy to submit that as a starting point.

Sounds like a separate assembly would be good for it (HtmlTextWriter itself should probably be in its own assembly as well as it's more general purpose). How about the following:

  • Fritz.BlazorWebFormsComponents.HtmlTextWriter
  • Fritz.BlazorWebFormsComponents.UserControl

twsouthwick avatar Mar 31 '20 17:03 twsouthwick

I just took a look at the structure of the library, and it looks like two of the issues are already available. Nice!

twsouthwick avatar Mar 31 '20 17:03 twsouthwick

Ooh... HtmlTextWriter sounds like a VERY cool feature to add

csharpfritz avatar Mar 31 '20 18:03 csharpfritz

@twsouthwick any updates on this or what you did for a private project?

hishamco avatar Sep 05 '20 00:09 hishamco