You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/WinUIEx/WinUIEx.csproj
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@
26
26
- Don't attempt to use window persistence in un-packaged applications.
27
27
- WebAuthenticator: now supports cancellation tokens.
28
28
- WebAuthenticator: Avoids an issue where state parameters are not always correctly handled/preserved correctly by OAuth services (reported in PR #92).
29
+
- Persistence: Add support for custom Window state persistence storage, for use by unpackaged applications (Issue #61).
e.Handled=true;// Don't let WinUI resize the window due to a dpi change caused by restoring window position - we got this.
274
273
break;
275
274
}
@@ -294,34 +293,64 @@ private struct MINMAXINFO
294
293
295
294
#region Persistence
296
295
297
-
/// <summary>
298
-
/// Gets or sets a unique ID used for saving and restoring window size and position
299
-
/// across sessions.
300
-
/// </summary>
301
296
/// <remarks>
302
297
/// The ID must be set before the window activates. The window size and position
303
298
/// will only be restored if the monitor layout hasn't changed between application settings.
304
299
/// The property uses ApplicationData storage, and therefore is currently only functional for
305
300
/// packaged applications.
301
+
/// By default the property uses <see cref="ApplicationData"/> storage, and therefore is currently only functional for
302
+
/// packaged applications. If you're using an unpackaged application, you must also set the <see cref="PersistenceStorage"/>
303
+
/// property and manage persisting this across application settings.
306
304
/// </remarks>
305
+
/// <seealso cref="PersistenceStorage"/>
307
306
publicstring?PersistenceId{get;set;}
308
307
309
-
privatebool_restoringPersistance;// Flag used to avoid WinUI DPI adjustment
308
+
privatebool_restoringPersistence;// Flag used to avoid WinUI DPI adjustment
309
+
310
+
/// <summary>
311
+
/// Gets or sets the persistence storage for maintaining window settings across application settings.
312
+
/// </summary>
313
+
/// <remarks>
314
+
/// For a packaged application, this will be initialized automatically for you, and saved with the application identity using <see cref="ApplicationData"/>.
315
+
/// However for an unpackaged application, you will need to set this and serialize the property to/from disk between
316
+
/// application sessions. The provided dictionary is automatically written to when the window closes, and should be initialized
0 commit comments