Saving WPF WIndow and Position

Posted by moogs on Stack Overflow See other posts from Stack Overflow or by moogs
Published on 2010-05-17T04:25:51Z Indexed on 2010/05/17 4:30 UTC
Read the original article Hit count: 245

Filed under:
|

What would be the best way to save the window position and size in a WPF app?

Currently, I'm saving the window size and position of a WPF App. Here are the events I handle:

  1. SourceInitialized : The saved info is loaded on to the window
  2. WindowClosing : The current info is saved to the backing store

(I copied this from an example).

The problem is, when the window is minimized and restored, the settings from the last WindowClosing is retrieved.

Now, the StateChanged event fire AFTER the window has minimized, so it does not seem to be what i need.

Thanks

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Windows