I have a UserControl with some buttons. My button have the default FocusVisualStyle (the border around the button).
When I move my user control with the mouse, this dotted border does not move with it. When you hover over another part of the screen it moves into the correct position.
I don't want to set the FocusVisualStyle to null, because I need to see what element is focused. I tried to create my own FocusVisualStyle but it behaves like the default one.
Can I somehow synchronize this border with the rest of the elements?
Thanks for help
As stated by bitbonk, the RenderTransform does not cause another arrange pass so the focus visual will not move. You can read this Dr. WPF article which discusses the issue as well as providing a couple of workarounds. The easiest in your case is to just put an AdornerDecorator within your UserControl around the content of your UserControl so that the AdornerLayer is moved too.