MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.29k stars 2.45k forks source link

Clean up resources #3735

Closed Nuklon closed 4 years ago

Nuklon commented 4 years ago

Currently this is included in MahApps.Metro.dll, but unused: MahApps.Metro.Styles.Themes.GeneratorParameters.json‎ (17234 bytes, Embedded, Public) MahApps.Metro.Styles.Themes.Theme.Template.xaml‎ (50905 bytes, Embedded, Public)

This ttf is massive and only used in FontIcon, does this really need to ship in this package? It seems to me like this belongs in IconPacks. 0x00080B1E: assets/segmdl2.ttf‎ = 257444 bytes

Would it also be possible to move themes to separate DLLs? I'm asking because I'm not sure how often all of these are used at once and each theme (light+dark) adds 64KB to the library.

Describe the solution you'd like Remove unused resources, discuss the other two resources.

batzen commented 4 years ago

The first two files are related to runtime theme generation. Those are currently only used in the showcase application but will be used to generate themes according to the chosen windows accent color in the future, once i am done with the ThemeManager code in ControlzEx.

Can't say much about the other files you named.

Why should themes be moved to a separate dll? It would be harder to maintain and coordinate different nuget releases. Each theme is 19-20 KB on disk. Let's say 48 themes take up 1 MB. The MahApps.Metro assembly takes up 2 MB in total. Are 2 MB too much? And if, too much for what? While it's possible to save some KB here, i am not sure if it's really worth the effort and increased maintenance cost.

timunie commented 4 years ago

Hi @Nuklon , The font is needed for the new CheckBox Style Win10 #3534 . It would run only on Windows10 computers if we dont ship this Font. I for example still need to target Win7.