@@ -219,12 +219,18 @@ private void NewCommandHandler()
219
219
220
220
if ( isDefaultApplicationSettings )
221
221
{
222
- Items . Add (
223
- new KeyValueTemplateItemViewModel (
224
- dataKey ,
225
- dataValue ,
226
- template : null ,
227
- templateLocations : null ) ) ;
222
+ var item = new KeyValueTemplateItemViewModel (
223
+ dataKey ,
224
+ dataValue ,
225
+ template : null ,
226
+ templateLocations : null ) ;
227
+
228
+ Items . Add ( item ) ;
229
+
230
+ Messenger . Default . Send (
231
+ new UpdateDefaultApplicationSettingsMessage (
232
+ TriggerActionType . Insert ,
233
+ item ) ) ;
228
234
}
229
235
else
230
236
{
@@ -347,6 +353,14 @@ private void DeleteCommandHandler(
347
353
348
354
Items . Remove ( item ) ;
349
355
356
+ if ( isDefaultApplicationSettings )
357
+ {
358
+ Messenger . Default . Send (
359
+ new UpdateDefaultApplicationSettingsMessage (
360
+ TriggerActionType . Delete ,
361
+ item ) ) ;
362
+ }
363
+
350
364
IsDirty = true ;
351
365
}
352
366
@@ -376,8 +390,7 @@ private List<ILabelControlBase> CreateLabelControls(
376
390
var labelTextBoxValue = new LabelTextBox
377
391
{
378
392
LabelText = "Value" ,
379
- IsMandatory = true ,
380
- MinLength = 1 ,
393
+ IsMandatory = false ,
381
394
} ;
382
395
383
396
if ( updateItem is not null )
@@ -464,15 +477,15 @@ private void HandleEditDialogResult(
464
477
465
478
if ( isDefaultApplicationSettings )
466
479
{
467
- if ( string . IsNullOrEmpty ( dataValue ) )
468
- {
469
- return ;
470
- }
471
-
472
480
updateItem . Value = dataValue ;
473
481
updateItem . Template = null ;
474
482
updateItem . TemplateLocations = null ;
475
483
484
+ Messenger . Default . Send (
485
+ new UpdateDefaultApplicationSettingsMessage (
486
+ TriggerActionType . Update ,
487
+ updateItem ) ) ;
488
+
476
489
UpdateComponentProviders ( updateItem ) ;
477
490
}
478
491
else
@@ -536,6 +549,14 @@ componentProvider.InstallationFolderPath.TemplateLocations is not null &&
536
549
componentProvider . InstallationFolderPath . Value = ResolveTemplateValue ( updateItem , componentProvider , componentProvider . InstallationFolderPath . Template ) ;
537
550
}
538
551
552
+ foreach ( var item in componentProvider . DefaultApplicationSettings . Items )
553
+ {
554
+ if ( item . Key == updateItem . Key )
555
+ {
556
+ item . Value = updateItem . Value ;
557
+ }
558
+ }
559
+
539
560
foreach ( var item in componentProvider . ApplicationSettings . Items )
540
561
{
541
562
if ( item . Template is not null &&
0 commit comments