コード例 #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            int pos = DataGrid.SelectedIndex;

            if (pos == -1)
            {
                MessageBox.Show("Seleccione una carrera", "Error");
                return;
            }

            Race race;

            try
            {
                race = (Race)DataGrid.SelectedItem;
            }
            catch (InvalidCastException)
            {
                return;
            }
            RaceForm window = new RaceForm((Race)race.Clone(), pos);

            window.ShowDialog();
        }
コード例 #2
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            RaceForm window = new RaceForm();

            window.ShowDialog();
        }