public static async void ShowDeleteProfileDialog(IProfileViewModel viewModel, IDialogCoordinator dialogCoordinator, ProfileInfo selectedProfile) { var customDialog = new CustomDialog { Title = Resources.Localization.Strings.DeleteProfile }; var confirmRemoveViewModel = new ConfirmRemoveViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); RemoveProfile(selectedProfile); }, instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); }, Resources.Localization.Strings.DeleteProfileMessage); customDialog.Content = new ConfirmRemoveDialog { DataContext = confirmRemoveViewModel }; viewModel.OnProfileDialogOpen(); await dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); }
public static async void ShowEditGroupDialog(IProfileViewModel viewModel, IDialogCoordinator dialogCoordinator, string group) { var customDialog = new CustomDialog { Title = Resources.Localization.Strings.EditGroup }; var editGroupViewModel = new GroupViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); RenameGroup(instance.OldGroup, instance.Group); viewModel.RefreshProfiles(); }, instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); }, group, GetGroups()); customDialog.Content = new GroupDialog { DataContext = editGroupViewModel }; viewModel.OnProfileDialogOpen(); await dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); }
public static async void ShowCopyAsProfileDialog(IProfileViewModel viewModel, IDialogCoordinator dialogCoordinator, ProfileInfo selectedProfile) { var customDialog = new CustomDialog { Title = Resources.Localization.Strings.CopyProfile }; var profileViewModel = new ProfileViewModel(instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); AddProfile(instance); }, instance => { dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); viewModel.OnProfileDialogClose(); }, GetGroups(), ProfileEditMode.Copy, selectedProfile); customDialog.Content = new ProfileDialog { DataContext = profileViewModel }; viewModel.OnProfileDialogOpen(); await dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); }