private void RemoveCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e) { var item = (CompositionItem)e.Parameter; var res = new MessageBoxBuilder() .Owner(this) .Caption(Title) .Text(LocalizedStrings.Str2884Params.Put(item.Element.Name)) .Button(MessageBoxButton.YesNo) .Icon(MessageBoxImage.Question) .Show(); if (res != MessageBoxResult.Yes) { return; } var control = _layoutManager .DockingControls .OfType <DiagramEditorControl>() .FirstOrDefault(c => c.Key.CompareIgnoreCase(item.Key)); if (control != null) { control.ResetIsChanged(); _layoutManager.CloseDocumentWindow(control); } _strategiesRegistry.Remove(item); }