File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
samples/MetroDemo/ExampleWindows Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,21 @@ public WINDOWPLACEMENT? Placement {
56
56
}
57
57
}
58
58
59
- private bool upgradeSettings = true ;
60
-
61
59
/// <summary>
62
60
/// Upgrades the application settings on loading.
63
61
/// </summary>
62
+ [ UserScopedSetting ]
64
63
public bool UpgradeSettings
65
64
{
66
- get { return upgradeSettings ; }
67
- set { upgradeSettings = value ; }
65
+ get
66
+ {
67
+ if ( this [ "UpgradeSettings" ] != null )
68
+ {
69
+ return ( bool ) this [ "UpgradeSettings" ] ;
70
+ }
71
+ return true ;
72
+ }
73
+ set { this [ "UpgradeSettings" ] = value ; }
68
74
}
69
75
}
70
76
Original file line number Diff line number Diff line change @@ -23,6 +23,15 @@ public FlyoutDemo()
23
23
e . Cancel = true ;
24
24
}
25
25
} ;
26
+
27
+ var mainWindow = ( MetroWindow ) this ;
28
+ var windowPlacementSettings = mainWindow . GetWindowPlacementSettings ( ) ;
29
+ if ( windowPlacementSettings . UpgradeSettings )
30
+ {
31
+ windowPlacementSettings . Upgrade ( ) ;
32
+ windowPlacementSettings . UpgradeSettings = false ;
33
+ windowPlacementSettings . Save ( ) ;
34
+ }
26
35
}
27
36
28
37
public void Launch ( )
You can’t perform that action at this time.
0 commit comments