/// <summary> /// Initializes a new instance of the <see cref="RenameProfileDialog"/> class. /// </summary> /// <param name="viewModel">The view model.</param> public RenameProfileDialog(RenameProfileDialogViewModel viewModel) { InitializeComponent(); DataContext = viewModel; viewModel.Accepted += Accepted; viewModel.Canceled += Canceled; }
/// <inheritdoc /> public string ShowRenameDialog(string currentName, IEnumerable <string> profiles) { var vm = new RenameProfileDialogViewModel(currentName, profiles); var dialog = new RenameProfileDialog(vm); var result = dialog.ShowDialog(); if (result.HasValue && result.Value) { return(vm.NewProfileName); } return(null); }