.NET WPF Remember window size between sessions

后端 未结 12 904
悲哀的现实
悲哀的现实 2020-11-30 20:33

Basically when user resizes my application\'s window I want application to be same size when application is re-opened again.

At first I though of handling SizeChange

12条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 20:55

    Actually you don't need to use code-behind to do that (except for saving the settings). You can use a custom markup extension to bind the window size and position to the settings like this :

    
    

    You can find the code for this markup extension here : http://www.thomaslevesque.com/2008/11/18/wpf-binding-to-application-settings-using-a-markup-extension/

提交回复
热议问题