Пример #1
0
        private void RemoveButton_Click_1(object sender, RoutedEventArgs e)
        {
            AccList acclist = (AccList)FindResource("acclist");


            AccIoList acciolist = (AccIoList)FindResource("acciolist");

            int idx = 0;

            while (idx < acciolist.Count)
            {
                AccIo acio = acciolist[idx];
                if (acio.Id.Equals(acclist[listbox1.SelectedIndex].Id))
                {
                    acciolist.RemoveAt(idx);
                    //acciolist.Remove(aio);
                }
                else
                {
                    ++idx;
                }
            }

            if (listbox1.SelectedIndex >= 0)
            {
                acclist.RemoveAt(listbox1.SelectedIndex);
            }
        }
Пример #2
0
 public MainWindow()
 {
     InitializeComponent();
     acclist   = (AccList)FindResource("acclist"); //-> 해줘야함
     acciolist = (AccIoList)FindResource("acciolist");
 }