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

Menu images? #16

Open
ZedZipDev opened this issue Jan 23, 2020 · 7 comments
Open

Menu images? #16

ZedZipDev opened this issue Jan 23, 2020 · 7 comments
Labels
Feature New feature that will be added to the project Up For Grabs This issue is available to anyone that wants to help

Comments

@ZedZipDev
Copy link

How to use images in menu like menu in the VS2019 Blazor default app?

i.e. how to add images in this sample?

<BlazoredMenu MenuBuilder="@MenuBuilder" />
@functions {
    MenuBuilder MenuBuilder = new MenuBuilder();

    protected override void OnInit()
    {
        MenuBuilder.AddItem(1, "Home", "/")
                   .AddSubMenu(2, "Sub Menu", new MenuBuilder().AddItem(1, "Counter", "counter")
                   .AddItem(3, "FetchData", "fetchdata");
    }
}
@chrissainty
Copy link
Member

We don't have support for this feature right now. But I can add it to the backlog, this library needs some time spent on it but I've just not had the chance for a while.

@ZedZipDev
Copy link
Author

ZedZipDev commented Jan 24, 2020

Thank you @chrissainty , it will be good feature

@chrissainty chrissainty added Feature New feature that will be added to the project Up For Grabs This issue is available to anyone that wants to help and removed enhancement labels Mar 9, 2020
@ThaRaven403
Copy link

@chrissainty did you have an idea of how images could be integrated?

A first step could be to support a string specifying the icon class(es) to use that would add a span. But I could see this going in all directions with custom markup, svg images, and so on...

There's also the question of positioning the icon. Again, default could be on the left of the text, but customization could go far here also.

I'd be interested in working on this one (more work than small bug fixes for a change 😂), but I'd like to confirm your vision on this.

@chrissainty
Copy link
Member

Hey @ThaRaven403 - If I'm honest I've not had the chance to give it any thought. This library is in desperate need of some TLC and probably needs a full redesign as it's not really been touched since I built it. Do you have any thoughts on it?

@ThaRaven403
Copy link

ThaRaven403 commented Jul 4, 2020

@chrissainty Maybe going full blown on the builder pattern would help. With individual builder properties for each of the menu settings, it would then be easy to then build it using a certain logic depending on what options you set. Like with any builder, someone could go and add a SVG and icon class for example, but the build method could manage that and the behavior would be self explanatory.

And with that in place, it would be easy to add new features without revamping the whole thing; only a new builder method, the implementation in the Build and the HTML.

(edited to tag you, didn't know if notifications are going through)

@chrissainty
Copy link
Member

@ThaRaven403 Sounds good. I'm happy for you to take the lead on this if you want to?

@ThaRaven403
Copy link

@chrissainty I'd be glad to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature that will be added to the project Up For Grabs This issue is available to anyone that wants to help
Projects
None yet
Development

No branches or pull requests

3 participants