private async void EditProfileAction() { CustomDialog customDialog = new CustomDialog() { Title = LocalizationManager.GetStringByKey("String_Header_EditProfile") }; IPScannerProfileViewModel ipScannerProfileViewModel = new IPScannerProfileViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); IPScannerProfileManager.RemoveProfile(SelectedProfile); IPScannerProfileInfo ipScannerProfileInfo = new IPScannerProfileInfo { Name = instance.Name, IPRange = instance.IPRange, Group = instance.Group }; IPScannerProfileManager.AddProfile(ipScannerProfileInfo); }, instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, IPScannerProfileManager.GetProfileGroups(), SelectedProfile); customDialog.Content = new IPScannerProfileDialog { DataContext = ipScannerProfileViewModel }; await dialogCoordinator.ShowMetroDialogAsync(this, customDialog); }
private async void DeleteProfileAction() { MetroDialogSettings settings = AppearanceManager.MetroDialog; settings.AffirmativeButtonText = Application.Current.Resources["String_Button_Delete"] as string; settings.NegativeButtonText = Application.Current.Resources["String_Button_Cancel"] as string; settings.DefaultButtonFocus = MessageDialogResult.Affirmative; if (MessageDialogResult.Negative == await dialogCoordinator.ShowMessageAsync(this, Application.Current.Resources["String_Header_AreYouSure"] as string, Application.Current.Resources["String_DeleteProfileMessage"] as string, MessageDialogStyle.AffirmativeAndNegative, settings)) { return; } IPScannerProfileManager.RemoveProfile(SelectedProfile); }
private async void DeleteProfileAction() { CustomDialog customDialog = new CustomDialog() { Title = LocalizationManager.GetStringByKey("String_Header_DeleteProfile") }; ConfirmRemoveViewModel confirmRemoveViewModel = new ConfirmRemoveViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); IPScannerProfileManager.RemoveProfile(SelectedProfile); }, instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, LocalizationManager.GetStringByKey("String_DeleteProfileMessage")); customDialog.Content = new ConfirmRemoveDialog { DataContext = confirmRemoveViewModel }; await dialogCoordinator.ShowMetroDialogAsync(this, customDialog); }
private async void DeleteProfileAction() { CustomDialog customDialog = new CustomDialog() { Title = Application.Current.Resources["String_Header_DeleteProfile"] as string }; ConfirmRemoveViewModel confirmRemoveViewModel = new ConfirmRemoveViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); IPScannerProfileManager.RemoveProfile(SelectedProfile); }, instance => { dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, Application.Current.Resources["String_DeleteProfileMessage"] as string); customDialog.Content = new ConfirmRemoveDialog { DataContext = confirmRemoveViewModel }; await dialogCoordinator.ShowMetroDialogAsync(this, customDialog); }