Question

I have made some custom attached properties that enable me to create a "pop out" effect on any control.

It animates the width and/or height when a boolean DependencyProperty is toggled.

Is there a good way to set all ScrollViewer's scrollbar visibility inside the control to hidden during this effect? You can see some ugly scrollbars appear during the animation.

I would rather not have to traverse the visual tree at the start of the animation, and then do it again when the animation completes.

EDIT: Although an alternate solution would be nice, at this point I'd rather bind to a readonly attached property named IsAnimating to handle setting the scroll visibility.

Is there a global way to to this?

Was it helpful?

Solution

Instead of animating the width of the control itself, try fixing its width at the start of the animation and reparenting it into a grid, and animate the grid's width instead. The original visual wouldn't change size in its own little world, and no scroll bars would appear or change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top