TextBox throws an exception when building library/plugin for Autodesk Revit
See original GitHub issueI’m building a WPF plugin for Autodesk Revit application. I included Material design to my app. Here is a dummy project, it demonstrates the same problem that i’m facing in my actual application.
Since i’m building a library, i do not have app.xaml. I merged resources in the Resource dictionary file and i use them in the Window1 window.
When using TextBox, the application breaks, i get the following error:
System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Inner exception: NotImplementedException: The method or operation is not implemented.
Stack trace is the following:
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at brisi.Window1.InitializeComponent() in C:\Users\Default\Desktop\brisi\brisi\Window1.xaml:line 1
I do have to point out that i have two bullshit lines of code in my .xaml.cs file:
ColorZoneAssist.SetMode(new CheckBox(), ColorZoneMode.Accent); Hue hue = new Hue("xyz", System.Windows.Media.Color.FromArgb(1, 2, 3, 4), System.Windows.Media.Color.FromArgb(1, 5, 6, 7));
. I don’t have a good understanding of how Revit loads libraries that my plugin is using, but if i don’t use those two lines, the app breaks [this problem].
I understand that debugging this problem will be difficult if you don’t have access to Autodesk Revit. Any help will be appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
@Keboo yes it works, I didn’t test it before with prerelease version, my bad, only with the stable branch. Thank you for your time to check this out.
@dfistric can you re-test with 3.0.0-ci3552 or later. I believe that the fix is already done for that.