AnimatedExpander keeps Width after being collapsed

Ribbon for WPF Forum

Posted 5 years ago by Martin Harder
Version: 14.1.0601
Avatar

Hello,

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">
<StackPanel>
<shared:AnimatedExpander Header="myHeader">
<Grid ...

Any hints are most welcome.

[Modified 5 years ago]

Comments (2)

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

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 5 years ago by Martin Harder
Avatar

Thank you for clarifying! I can live with that.

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.