AnimatedExpander keeps Width after being collapsed

Ribbon for WPF Forum

Posted 10 years ago by Martin Harder
Version: 14.1.0601


I am using the AnimatedExpander with a content that is wider than the containing scroll viewer. So a horizontal scroll bar appears when I fill the content on expanding. When I collapse the AnimatedExpander the scroll bar doesn't change, as if the content was still visible. I believe that the AnimatedExpander retains its width even when collapsed.

I can evade this problem by binding the Visibility of the content to the IsExpanded of the AnimatedExpander.

Still I wonder if this is an issue of the AnimatedExpander or is there maybe a way to force the AnimatedExpander to use its Header for Width when it is not expanded?

<ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CanContentScroll="False" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<shared:AnimatedExpander Header="myHeader">
<Grid ...

Any hints are most welcome.

[Modified 10 years ago]

Comments (2)

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Martin,

When I did a simple repro, I saw it initially collapsed to the content's width, which does look correct based on how the AnimatedExpanderDecorator (the main piece that supports the animations within the AnimatedExpander) is coded.  It is designed to keep a consistent width regardless of whether the expander is collapsed or expanded.  The only way to get it to stop that behavior would be to do as you said and alter the visibility of the content.

Actipro Software Support

Posted 10 years ago by Martin Harder

Thank you for clarifying! I can live with that.

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.