pyRevit with MaterialDesign from XAML

I’m trying to use the material design libraries in a wpf window created with pyrevit.
To do that, I add the clr reference to the material design libraries dll’s as such:


Then, in the XAML for the window I add:

                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />

At this point, when opening my XAML in Visual Studio I can already see the styles from Material Design being applied.
The problem is that when I run my script, I get the following error:

Can you help me figure out what’s missing? Is it even a problem with pyRevit or ironpython itself?