Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

UserControl inside TemplatedControl doesn't show up in the Design Preview

Open RationalFragile opened this issue 1 year ago • 3 comments

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:

  1. New project, Avalonia 11 Preview
  2. Add a new TemplatedControl and UserControl from the Add template
  3. Add the TemplatedControl to the MainWindow
  4. Add TemplateControl to the App.axaml styles
  5. Add the UserControl to the Template inside TemplatedControlTest.axaml
  6. 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 avatar Sep 25 '22 21:09 RationalFragile

@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?

maxkatz6 avatar Sep 26 '22 21:09 maxkatz6

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 in the preview of TemplatedControlTest

How it looks at runtime at runtime

How it looks in the MainWindow.axaml preview in the preview of MainWindow

RationalFragile avatar Sep 26 '22 22:09 RationalFragile

Did anyone manage to reproduce the issue using the code/zip I provided? Any solutions?

RationalFragile avatar Oct 20 '22 14:10 RationalFragile