Adorner does not appear

I am using UserControl which contains Canvas. As a canvas child, there is content control with adorner. Why the adorner is not visible, perhaps the adorner layer is delayed. Everything is created and applied. The adorner level is very high in the visual tree. The adorner layer is hosted outside the UserControl.

I know this is created because I have implemented a basic motion mechanism that works, but the decorator never shows up.

What needs to be done to show the decorator?

+3


source to share


1 answer


The WPF window has an AdornerDecorator by default, but usercontrol does not. Therefore, you just need to wrap your canvas with the Adorner decorator in your usercontrol.xaml:

<AdornerDecorator ClipToBounds="True">
            <Canvas x:Name="DesignerCanvas"
            ClipToBounds="True"
            SnapsToDevicePixels="True"/>
</AdornerDecorator>

      



More information: https://social.msdn.microsoft.com/Forums/vstudio/en-US/43a2565d-df21-4cf3-aa2a-240d67662945/please-help-me-resolve-a-mistery-with-resource-adorner -and-usercontrol-a-bug? forum = wpf

+2


source







All Articles