private void btnNoteAdd_Click(object sender, RoutedEventArgs e) { ReadWriteNoteWindow a = new ReadWriteNoteWindow(false, DBModel.Instance.User.PersonId); a.ShowDialog(); if (a.Note != null) { List<note> list = this.dataGridNotes.ItemsSource as List<note>; this.dataGridNotes.ItemsSource = null; list.Insert(0,a.Note); this.dataGridNotes.ItemsSource = list; } }
private void btnNoteRead_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; note n = b.DataContext as note; ReadWriteNoteWindow a = new ReadWriteNoteWindow(true, DBModel.Instance.User.PersonId,n); a.ShowDialog(); }