Determine size of SizeToContent WPF Window before its rendered

前端 未结 1 1585
后悔当初
后悔当初 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)
提交回复
热议问题