Пример #1
0
        private void btnAddNewLister_Click(object sender, RoutedEventArgs e)
        {
            ListerControl w = new ListerControl();

            if (w.ShowDialog() == true)
            {
                dgListers.ItemsSource = Lister.GetAllListersTable;
            }
        }
        private void btnAddNewLister_Click(object sender, RoutedEventArgs e)
        {
            ListerControl w = new ListerControl();

            if (w.ShowDialog() == true)
            {
                var ls = dgListers.ItemsSource as List <Lister>;
                ls.Add(w.DataContext as Lister);
                dgListers.Items.Refresh();
            }
        }
Пример #3
0
 private void btnUpdateLister_Click(object sender, RoutedEventArgs e)
 {
     if (dgListers.SelectedIndex >= 0)
     {
         ListerControl w = new ListerControl((int)(dgListers.Items[dgListers.SelectedIndex] as DataRowView)[0]);
         if (w.ShowDialog() == true)
         {
             dgListers.ItemsSource = Lister.GetAllListersTable;
         }
     }
 }