Determine size of SizeToContent WPF Window before its rendered

前端 未结 1 1586
后悔当初
后悔当初 2021-02-19 22:41

I have a window in my WPF application that is displayed on occasion. When it is shown it is faded in with an annimation, and when closed it is faded out. Nothing fancy, just a

相关标签:
1条回答
  • 2021-02-19 23:28

    I found the answer to my own question. After updating the content a simple call to the window's UpdateLayout() method forces an update. Calls to the width and height then return accurate values.

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