예제 #1
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            Car car = new Car();

            car.DateSell = DateTime.Now;
            WindowChild child = new WindowChild(car);

            if (child.ShowDialog() == true)
            {
                cars.Add(car);
            }
        }
예제 #2
0
        private void ButtonChange_Click(object sender, RoutedEventArgs e)
        {
            if (listCar.SelectedIndex != -1)
            {
                Car         car   = listCar.SelectedItem as Car;
                WindowChild child = new WindowChild(car);

                if (child.ShowDialog() == true)
                {
                    cars[listCar.SelectedIndex] = car;
                }
            }
        }