Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the internal modifier for BlazorBootstrapComponentBase to allow creating custom components using this wonderful core #690

Closed
yeifer-co opened this issue Apr 27, 2024 · 1 comment
Milestone

Comments

@yeifer-co
Copy link

Describe the bug
I'm attempting to create my own components based on the core of the BlazorBootstrap library, but I don't have access to some properties of the BlazorBootstrapComponentBase class because they are marked as internal. I would like to use this core as I find it very well-made. I want to define my own components for scenarios not covered by the available components in the library. In case it's not possible to remove the internal modifier due to reasons beyond my understanding, please provide a method for creating new components based on this core.

To Reproduce

  1. Attempt to create a custom component extending BlazorBootstrapComponentBase.
  2. Notice the inability to access certain properties or methods due to their internal modifier.
  3. Encounter limitations in creating custom components based on the BlazorBootstrap library's core functionality.

Expected behavior
I expect to be able to access all necessary properties and methods of the BlazorBootstrapComponentBase class to create custom components seamlessly.

Sample code
Sample code to reproduce the issue.

@namespace BlazorBootstrap
@inherits BlazorBootstrapComponentBase

<MyCustomComponent implementation>
namespace BlazorBootstrap;

public partial class MyCustomComponent : BlazorBootstrapComponentBase
{
     protected override void BuildClasses() {
            // Cannot access to AddClass because it is internal
     }
}
@gvreddy04 gvreddy04 added this to the 2.3.0 milestone Apr 30, 2024
@vikramlearning vikramlearning deleted a comment from mrpmorris May 6, 2024
@gvreddy04
Copy link
Contributor

@yeifer-co After next version, please use the below approach.

Example:

protected override string? ClassNames =>
    new CssClassBuilder(Class)
        .AddClass(BootstrapClass.Accordion)
        .AddClass(BootstrapClass.AccordionFlush, Flush)
        .Build();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants