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

后端 未结 2 1914
耶瑟儿~
耶瑟儿~ 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    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.

提交回复
热议问题