Page 1 of 1

custom UserControl : unable to preview this element

Posted: Mon Oct 17, 2016 4:04 am
by Sesztak
Dear JS-Support,
When we make a custom UserControl there is no XAML preview :
"unable to preview this element" with red background.

XAML and C#: nothing special just some TextBlock element.

Is it normal behaviour or a bug?

Br,
Péter

Re: custom UserControl : unable to preview this element

Posted: Wed Dec 28, 2016 3:18 am
by njs123
I am facing the same issue

I am creating a control inheriting from Panel
and it is not previewing in Preview Pane

Re: custom UserControl : unable to preview this element

Posted: Mon Jan 09, 2017 8:14 am
by JS-Support @Userware
Sesztak wrote:When we make a custom UserControl there is no XAML preview :
"unable to preview this element" with red background.
XAML and C#: nothing special just some TextBlock element.
Is it normal behaviour or a bug?


Hi Péter,

  • When you are editing the UserControl (meaning that you are seeing the XAML of the content of the UserControl), you should be able to see the preview. If not, can you please post your XAML code so that we can reproduce the bug?
  • When you are using the UserControl in another place, it is normal that the control appears as a red rectangle that cannot be previewed.

The general rule is this: with the current version of the XAML Preview, you cannot preview XAML elements that have a namespace (such as <mynamespace:MyControl />). However, elements without a namespace are supposed to be previewed properly.

Thanks.
Regards,
JS-Support