-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No parameterless constructor in custom theme #18273
Comments
It looks fine. How is this file referenced? Repro project doesn't show that. "Cannot dynamically create an instance" doesn't seem to be an Avalonia exception. |
It is referenced as a Avalonia XAML. In the App self its referenced like this:
The Thing is that the designer throws this error. The app starts and runs without any errors after the build. Greetings, Flo |
@Flo0806 do you have a complete repro? As you mentioned above, normally this code just works. I don't see anything unusual. |
Load the project, build it und then open the AvaloniaThemeTemplate.axaml in VS Designer. If you run the app you will see a pink button - The proof that the lib will work correctly and all Resources are found successfully. By the way: Is it normal that MergeResourceInclude throws a InnerException like "Unable to resolve XAML resource xxxx"? In build/run mode all is fine, no errors. Only in the Designer, again. |
@maxkatz6 Is the Repo ok? Can you reproduce the error? |
@Flo0806 designer works here. |
Or are you trying to preview |
Not really normal. You can use full |
Describe the bug
Hello,
I created a library with some custom controls and styles. I followed the guides and searched the code. I created an entry point like this:
C# (ControlThemes.axaml.cs)
ControlThemes.axaml
In the end all works as well if I start the application. But the designer show an error:
Cannot dynamically create an instance of type 'SD.Avalonia.UI.Controls.ControlThemes'. Reason: No parameterless constructor defined.
I wanna understand what to do... I checked other libraries and I haven't found any differences.
Greetings, Flo
To Reproduce
You can use this package, create a second Project (Avalon MVVM as example), add the library project to it and after a build open the AvaloniaThemeTemplate.axaml to see the error.
Link to the Repo: Here
Expected behavior
No errors :-)
Avalonia version
11.1.0 - 11.2.4
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: