Often when developing Revit plugins, WPF is used to create windows. Here I referenced the MaterialDesignThemes component, and I will record the corresponding steps and issues in this article.
Usage
Installation
Search for MaterialDesignThemes directly from nuget and install it.
## Issues
If you are using a multi-version automatic adaptation framework and referencing the latest version `4.60` component, even if adapted in a high framework version, it will report an error
`xamlParseException ---- DllNotFound`. At this time, modify the component package to `4.5.0` to adapt to the 2016 version of the framework to solve it.
Running
If you use AddinManager directly for debugging, you may not find problems, and all components will run normally. When we use the addin file to officially add, it will report an error xamlParseException ---- DllNotFound. Here are several solutions:
There are four articles above. The first method is to initialize the class in the material component to force the program to retrieve the dll under the path to load the file, but it still fails in Revit. The third and fourth are similar problems, open source author responses, you can refer to them.
Solution
If you use the MVVM pattern, you can get the MainViewModel in the StartUp class and reference the materialTheme.wpf dll file, and unify the previously encountered dll files with load problems.