How to get desired height of WPF UI element with current height of 0?

后端 未结 2 1902
耶瑟儿~
耶瑟儿~ 2020-12-21 04:05

My ultimate goal is to animate the change in size between two UserControls. The way that I have attempted to achieve this has produced one major problem.

I start wit

相关标签:
2条回答
  • 2020-12-21 04:35

    Maybe it's easier to animate the LayoutTransform.ScaleY of your target from 0 to 1, because desired height is always 1 and no extra control is needed.

    0 讨论(0)
  • 2020-12-21 04:59

    You can put the content you want the size of into a Canvas with ClipToBound="True". Then you can manipulate the size of the Canvas and yet the size of the content inside the Canvas will always be its full desired size.

    0 讨论(0)
提交回复
热议问题