DigitalAdeel / MaterialSkin2DotNet

62 stars 18 forks source link

MaterialLabel throws an Exception for Font Type #14

Open JacobDahlke opened 1 year ago

JacobDahlke commented 1 year ago

This is a bit of a complex one and may entirely be my fault on how I'm using this (fantastic) package.

  1. This is being used in a VSTO Addin for Word (Barf, I know)
  2. There are "pure" MaterialForms being used and I'm also using some of the material UI components in a TaskPane / User Control. Everything seems to render just fine - I'm opening a MaterialForm in the background and loading it to the forms to manage, but it's hidden. This allows the controls on my UserControl to load just fine.

However, I get exceptions (occasionally) "The given key was not present in the dictionary." linking back to: this.materialLabel1.FontType = MaterialSkin.MaterialSkinManager.fontType.H6;

This is in the .Designer of the user control. A simple rebuild will allow the application to start just fine. Any thoughts or ideas? Or am I just stretching the intended use too far?

DigitalAdeel commented 1 year ago

Thanks for using something that I developed cuz original author didn't ;) Btw, I'm too tired to test this issue atm, so I'll take a look at it tomorrow morning (InshaAllah)

DigitalAdeel commented 1 year ago

@JacobDahlke btw, can you send me a screenshot of the exception?

JacobDahlke commented 1 year ago

I will once it occurs again. It happens seemingly at random.

JacobDahlke commented 1 year ago

image image

Again, a rebuild seems to fix the issue. I should also note that I could not get the nuget package to work with VSTO project, a problem not limited to this nuget package, so I'm referencing the DLL directly which could be a contributing factor.