private static void CreateAndDisplayModalItem(object owner, object model) { DisplayItem item = CreateItem(model); //the item must be added to the active items now because the modal display //could block the further execution until the dialog is closed and therefore the bury method will throw a exception _activeItems.Add(item); _viewHandler.DisplayModal(owner, item.View); }