Open onlytropics opened 2 years ago
I hope @orapps44 to merge it.
Edit: I suggest (as @leocb said) to use something else for WinForms, or to switch to WPF or something else, as long as this project I don't think it will be maintained anymore. 😌
I yolo merged it. Not sure when another version will be uploaded to nuget, but feel free to compile it and use it yourself
I am using the drawer with the flag ShowIconsWhenHidden set (although that shouldn't make a difference really). After the user did some input, a new Tab is created at runtime and inserted after the currently active tab. At this point, the currently active Tab and all the following ones do not display their icons anymore.
Looked at the source code and found the private method preProcessIcons, which I guessed had something to do with it. It is called when ShowIconsWhenHidden is modified so I tried
after inserting the new tab and it definitely helps. Now only the current tab and the new tab's icons are missing.
I had to change MaterialDrawer.cs lines 288-290 to
as the Add() which was there previously throws an Exception if the key already exists, essentially making calling preProcessIcons more than once impossible.
It also seems that the tabs can't share icons? It seems if I set more than one tab to the same Icon ID, they are not displayed.