private void DeletePropertyGroup(object sender, RoutedEventArgs e) { GroupElement groupElement = PropertyGroups.SelectedItem as GroupElement; if (groupElement != null) { PropertyGroupElement selElm = groupElement.ElementBase as PropertyGroupElement; if (selElm != null) { if (!selElm.IsImported) { DeleteQuestionDialog dialog = new DeleteQuestionDialog(); bool?dialogResult = dialog.ShowDialog(); if (dialogResult.Value) { m_Project.DeletePropertyGroup(groupElement); } } } else { DeletePropertyGroupBtn.IsEnabled = false; } } }