Skip to content

Community.Toolbox and IconPack in Code Behind #346

Answered by Petronius-ch
Petronius-ch asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for answering (sorry for being a bit late...) - I got the idea. It works now :-)

First, in the ShellViewModel.cs I added this to MenuItems:

        new HamburgerMenuIconItem()
            {
                Label = "Duck Icon", 
                Icon = new PackIconMaterial() 
                {
                    Kind = PackIconMaterialKind.Duck 
                },
                TargetPageType = typeof(MyPageViewModel)
            }

Next I had to add a new TemplateSelector in the Class MenuItemTemplateSelector (which is missing):

    public DataTemplate IconPackDataTemplate { get; set; }
...
        if (item is HamburgerMenuIconItem)
        {
            return IconPackDataTempla…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Petronius-ch
Comment options

Answer selected by Petronius-ch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants