-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Upgrade WindowPlacementSettings on version change #1787
Conversation
- Added a UpgradeSettings property to IWindowPlacementSettings, which defaults to true - Added a `void Upgrade()` method to IWindowPlacementSettings, which is implemeneted by ApplicationSettingsBase
@mike-ward is this what you need? is this enough? |
I think the |
@mike-ward so the others (at th einterface) too much? |
Probably. I can't think of a use case where I would want to reset or reload those settings. For my use case, |
@mike-ward ok, you're right. i removed the reset method. |
Upgrade WindowPlacementSettings on version change
Hm, that's a breaking change, but I guess it's alright |
Upgraded to 1.1.0. Could I get a quick tutorial on how to upgrade settings? Here is what I've tried. In App.xaml.cs,
UpgradeSettings is always false. I must be missing something else where? |
it's a mistake with
|
Cool beans! The window snap restore thing is working nicely. On Tue, Feb 24, 2015 at 7:03 PM, Jan Karger [email protected]
|
@mike-ward |
Different problem. Using code from above, |
@mike-ward to clarify this, i will change the implementation to this /// <summary>
/// Upgrades the application settings on loading.
/// </summary>
[UserScopedSetting]
public bool UpgradeSettings
{
get
{
if (this["UpgradeSettings"] != null)
{
return (bool)this["UpgradeSettings"];
}
return true;
}
set { this["UpgradeSettings"] = value; }
} with the result
is this what you want? |
Yep, I think that will work. Thanks for doing this. |
@mike-ward np, but can you give me a reason why a user want change this property in this file? i don't see the benefit, maybe i'm blind ;-) |
You only want to upgrade the settings once per version bump. The suggested It doesn't matter to me if I keep a flag in my user settings or use the On Wed, Feb 25, 2015 at 5:55 PM, Jan Karger [email protected]
|
UpgradeSettings
property toIWindowPlacementSettings
, which defaults to truevoid Upgrade()
method toIWindowPlacementSettings
, which is implemeneted byApplicationSettingsBase
Closes #1736