Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaveWindowPosition does not upgrade WindowPlacementSettings on version change #1736

Closed
mike-ward opened this issue Jan 7, 2015 · 0 comments
Assignees
Milestone

Comments

@mike-ward
Copy link

When SaveWindowPosition is attached, the WindowPlacementSettings are not "upgraded" when the hosting program's version changes.

I don't see a way for a host to access the WindowPlacementSettings directly because they are protected and marked internal. It would also require a class definition to deserialize the window placement settings for each derived window type (I think). It seems possible the MahApps.Metro Library could upgrade these settings.

It appears based on my limited understanding that this could be accomplished as follows:

  • Add a UpgradeSettings property to IWindowPlacementSettings, which defaults to true
  • Add a void Upgrade() method to IWindowPlacementSettings, which is implemeneted by ApplicationSettingsBase
  • If on loading the UpgradeSettings flag is true, call _settings.Upgrade(), set the flag to false, and then _settings.Save()

This is the recommended way user settings are handled by programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants