@@ -48,6 +48,9 @@ public string Location
4848 /// </summary>
4949 public bool IsLocationManagedByPolicy => ! string . IsNullOrWhiteSpace ( PolicyManager . Current ? . Profiles_FolderLocation ) ;
5050
51+ /// <summary>
52+ /// Private field of <see cref="IsLocationChanged" /> property.
53+ /// </summary>
5154 private bool _isLocationChanged ;
5255
5356 /// <summary>
@@ -66,6 +69,9 @@ public bool IsLocationChanged
6669 }
6770 }
6871
72+ /// <summary>
73+ /// Private field of <see cref="IsDefaultLocation" /> property.
74+ /// </summary>
6975 private bool _isDefaultLocation ;
7076
7177 /// <summary>
@@ -84,8 +90,14 @@ public bool IsDefaultLocation
8490 }
8591 }
8692
93+ /// <summary>
94+ /// Private field of <see cref="ProfileFiles" /> property.
95+ /// </summary>
8796 private readonly ICollectionView _profileFiles ;
8897
98+ /// <summary>
99+ /// Gets the collection view of profile files.
100+ /// </summary>
89101 public ICollectionView ProfileFiles
90102 {
91103 get => _profileFiles ;
@@ -99,8 +111,15 @@ private init
99111 }
100112 }
101113
114+ /// <summary>
115+ /// Private field of <see cref="SelectedProfileFile" /> property.
116+ /// </summary>
117+
102118 private ProfileFileInfo _selectedProfileFile ;
103119
120+ /// <summary>
121+ /// Gets or sets the currently selected profile file information.
122+ /// </summary>
104123 public ProfileFileInfo SelectedProfileFile
105124 {
106125 get => _selectedProfileFile ;
@@ -114,8 +133,15 @@ public ProfileFileInfo SelectedProfileFile
114133 }
115134 }
116135
136+ /// <summary>
137+ /// Private field of <see cref="IsDailyBackupEnabled" /> property.
138+ /// </summary>
117139 private bool _isDailyBackupEnabled ;
118140
141+
142+ /// <summary>
143+ /// Gets or sets a value indicating whether daily backups are enabled.
144+ /// </summary>
119145 public bool IsDailyBackupEnabled
120146 {
121147 get => _isDailyBackupEnabled ;
@@ -132,8 +158,14 @@ public bool IsDailyBackupEnabled
132158 }
133159 }
134160
161+ /// <summary>
162+ /// Private field of <see cref="MaximumNumberOfBackups" /> property.
163+ /// </summary>
135164 private int _maximumNumberOfBackups ;
136165
166+ /// <summary>
167+ /// Gets or sets the maximum number of backups to keep.
168+ /// </summary>
137169 public int MaximumNumberOfBackups
138170 {
139171 get => _maximumNumberOfBackups ;
@@ -153,6 +185,9 @@ public int MaximumNumberOfBackups
153185
154186 #region Constructor, LoadSettings
155187
188+ /// <summary>
189+ /// Initializes a new instance of the <see cref="SettingsProfilesViewModel" /> class and loads the current profile files.
190+ /// </summary>
156191 public SettingsProfilesViewModel ( )
157192 {
158193 _isLoading = true ;
@@ -168,6 +203,9 @@ public SettingsProfilesViewModel()
168203 _isLoading = false ;
169204 }
170205
206+ /// <summary>
207+ /// Load view specific settings.
208+ /// </summary>
171209 private void LoadSettings ( )
172210 {
173211 Location = ProfileManager . GetProfilesFolderLocation ( ) ;
@@ -179,14 +217,6 @@ private void LoadSettings()
179217 #endregion
180218
181219 #region ICommands & Actions
182-
183- public ICommand OpenLocationCommand => new RelayCommand ( _ => OpenLocationAction ( ) ) ;
184-
185- private static void OpenLocationAction ( )
186- {
187- Process . Start ( "explorer.exe" , ProfileManager . GetProfilesFolderLocation ( ) ) ;
188- }
189-
190220 /// <summary>
191221 /// Gets the command that opens the location folder selection dialog.
192222 /// </summary>
@@ -209,14 +239,16 @@ private void BrowseLocationFolderAction()
209239 Location = dialog . SelectedPath ;
210240 }
211241
242+
212243 /// <summary>
213- /// Sets the location path based on the provided drag-and-drop input.
214- /// </summary>
215- /// <param name="path">The path to set as the location.</param>
216- public void SetLocationPathFromDragDrop ( string path )
244+ /// Gets the command that initiates the action to change the location.
245+ /// </summary>
246+ public ICommand OpenLocationCommand => new RelayCommand ( _ => OpenLocationAction ( ) ) ;
247+
248+ private static void OpenLocationAction ( )
217249 {
218- Location = path ;
219- }
250+ Process . Start ( "explorer.exe" , ProfileManager . GetProfilesFolderLocation ( ) ) ;
251+ }
220252
221253 /// <summary>
222254 /// Gets the command that initiates the action to change the location.
@@ -238,13 +270,8 @@ private async Task ChangeLocationAction()
238270 if ( ! result )
239271 return ;
240272
241- // Save settings at the current location before changing it to prevent
242- // unintended saves to the new location (e.g., triggered by background timer or the app close & restart).
243- SettingsManager . Save ( ) ;
244-
245273 // Set new location in SettingsInfo
246274 SettingsManager . Current . Profiles_FolderLocation = Location ;
247- SettingsManager . Save ( ) ;
248275
249276 // Restart the application
250277 ( Application . Current . MainWindow as MainWindow ) ? . RestartApplication ( ) ;
@@ -270,14 +297,9 @@ private async Task RestoreDefaultLocationActionAsync()
270297 if ( ! result )
271298 return ;
272299
273- // Save settings at the current location before changing it to prevent
274- // unintended saves to the new location (e.g., triggered by background timer or the app close & restart).
275- SettingsManager . Save ( ) ;
276-
277300 // Clear custom location to revert to default
278301 SettingsManager . Current . Profiles_FolderLocation = null ;
279- SettingsManager . Save ( ) ;
280-
302+
281303 // Restart the application
282304 ( Application . Current . MainWindow as MainWindow ) ? . RestartApplication ( ) ;
283305 }
@@ -551,4 +573,15 @@ await DialogHelper.ShowMessageAsync(Application.Current.MainWindow,
551573 }
552574
553575 #endregion
576+
577+ #region Methods
578+ /// <summary>
579+ /// Sets the location path based on the provided drag-and-drop input.
580+ /// </summary>
581+ /// <param name="path">The path to set as the location.</param>
582+ public void SetLocationPathFromDragDrop ( string path )
583+ {
584+ Location = path ;
585+ }
586+ #endregion
554587}
0 commit comments