1616using NETworkManager . ViewModels . Dialogs ;
1717using NETworkManager . Views . Dialogs ;
1818using System . Linq ;
19+ using System . Windows . Controls ;
1920
2021namespace NETworkManager . ViewModels . Applications
2122{
@@ -614,7 +615,6 @@ public ICommand DeleteProfileCommand
614615
615616 private async void DeleteProfileAction ( )
616617 {
617-
618618 CustomDialog customDialog = new CustomDialog ( )
619619 {
620620 Title = Application . Current . Resources [ "String_Header_DeleteProfile" ] as string
@@ -637,6 +637,38 @@ private async void DeleteProfileAction()
637637
638638 await dialogCoordinator . ShowMetroDialogAsync ( this , customDialog ) ;
639639 }
640+
641+ public ICommand EditGroupCommand
642+ {
643+ get { return new RelayCommand ( p => EditGroupAction ( p ) ) ; }
644+ }
645+
646+ private async void EditGroupAction ( object group )
647+ {
648+ CustomDialog customDialog = new CustomDialog ( )
649+ {
650+ Title = Application . Current . Resources [ "String_Header_EditGroup" ] as string
651+ } ;
652+
653+ EditGroupViewModel editGroupViewModel = new EditGroupViewModel ( instance =>
654+ {
655+ dialogCoordinator . HideMetroDialogAsync ( this , customDialog ) ;
656+
657+ IPScannerProfileManager . RenameGroup ( instance . OldGroup , instance . Group ) ;
658+
659+ _ipScannerProfiles . Refresh ( ) ;
660+ } , instance =>
661+ {
662+ dialogCoordinator . HideMetroDialogAsync ( this , customDialog ) ;
663+ } , group . ToString ( ) ) ;
664+
665+ customDialog . Content = new EditGroupDialog
666+ {
667+ DataContext = editGroupViewModel
668+ } ;
669+
670+ await dialogCoordinator . ShowMetroDialogAsync ( this , customDialog ) ;
671+ }
640672 #endregion
641673
642674 #region Methods
0 commit comments