private void btnAddPoint_Click(object sender, RoutedEventArgs e) { Topic t = lstTopics.SelectedItem as Topic; if (t == null) { return; } BusyWndSingleton.Show("Creating new argument..."); try { int orderNumber = OwnArgPoints.Any() ? OwnArgPoints.Last().Ap.OrderNumber + 1 : 1; var np = DaoUtils.NewPoint(lstTopics.SelectedItem as Topic, orderNumber); if (np != null) { theBadge.RemoveFocusFromInputControls(); theBadge.DataContext = np; t.ArgPoint.Add(np); } UpdatePointsOfTopic(lstTopics.SelectedItem as Topic); ArgPointExt newArgPointExt = OwnArgPoints.FirstOrDefault(i => i.Ap == np); lstPoints.SelectedItem = newArgPointExt; saveProcedure(null, -1); } finally { BusyWndSingleton.Hide(); } }