Avalonia
Avalonia copied to clipboard
UserControl inside TemplatedControl doesn't show up in the Design Preview
Describe the bug At runtime, I see my UserControl inside the TemplatedControl. In the design preview, the UserControl is not there.
To Reproduce Steps to reproduce the behavior:
- New project, Avalonia 11 Preview
- Add a new TemplatedControl and UserControl from the Add template
- Add the TemplatedControl to the MainWindow
- Add TemplateControl to the App.axaml styles
- Add the UserControl to the Template inside TemplatedControlTest.axaml
- Run the project, you'll see the UserControl, But the preview of TempledControl doesn't show the UserControl
Expected behavior The TemplatedControl preview should show the UserControl
Desktop (please complete the following information):
- OS: Windows 10
- Version 11.0.0-preview1
Additional context You can add some colored border in the Template of the TemplatedControl, you'll see that the border gets rendered in the preview but the UserControl does not.
@RationalFragile I used controls like this before with no issues. Can you also provide a repro so it's easier to check if there are no other problems?
Here is the solution/project exactly as outlined in the how to reproduce section: TemplateControlTest.zip
Here are some screenshots:
How it looks in TemplatedControlTest.axaml preview
How it looks at runtime
How it looks in the MainWindow.axaml preview
Did anyone manage to reproduce the issue using the code/zip I provided? Any solutions?