Gu.Wpf.Adorners icon indicating copy to clipboard operation
Gu.Wpf.Adorners copied to clipboard

Overlay.Info: bindings to DataContext don't work because it uses MS TemplatedAdorner

Open bogdan799 opened this issue 3 years ago • 1 comments

The issue is whenever you try to bind to the original datacontext from inside the Info adorner, it throws binding errors. After little investigations and source code decompilation, I figured out that internally MS TemplatedAdorner created a child and sets it's datacontext to validation errors. image

bogdan799 avatar Mar 07 '21 23:03 bogdan799

I solved that by specifying DataContext inside the template using RelativeSource to the first Adorner element, but it would be great if you could take a look and improve a library, cause in the readme you specified that the DataContext will be of the underlying object which is not correct at this point. Also thanks a lot for such a useful library, I'm making some drawing tool with WPF and it helps me a lot!

bogdan799 avatar Mar 07 '21 23:03 bogdan799