Closed sam-wheat closed 2 years ago
Hi! I see couple of problems with your project:
<AvaloniaResource Include="**\*.axaml" />
because Avalonia already adds "axaml" files to the resources. You basically make it duplicate; exactly what error says to you "Duplicate x:Class directive".Thank you @maxkatz6. I implemented your recommended changes and the errors I was encountering are gone. The new error (which is what I started with) is:
HResult=0x80131500 Message=No precompiled XAML found for controls:TemplatedControl1.axaml (baseUri: avares://AvaloniaApp2/App.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource Source=Avalonia.Markup.Xaml
Modified app attached.
Wrong StyleInclude syntax, the error tells you what can't be found and where it was defined (App.axaml).
<StyleInclude Source="avares://AvaloniaLibrary2/TemplatedControl1.axaml" />
Of course! What was I thinking! Thanks for the assist.
Expected behavior - Create an application project and a library project. Create a TemplatedControl in the lib project. Reference the lib from the app and use the app.
I am unable to guess how the above process works in Avalonia. Another user in one of the links below requested a tutorial also. I am unable to locate the tutorial.
https://github.com/AvaloniaUI/Avalonia/issues/2516 https://github.com/AvaloniaUI/Avalonia/issues/6475 https://github.com/AvaloniaUI/Avalonia/issues/6924 https://github.com/AvaloniaUI/Avalonia/issues/4456
Attached project is pretty much out-of-the-box and results in this error msg:
Adding this:
AvaloniaApp2.zip ml">
Results in this: