private void btn_agg_Click(object sender, RoutedEventArgs e)
        {
            //creao oggetto
            int    cil;
            double prez;
            bool   ok;

            ok = double.TryParse(txt_prezzo.Text, out prez);
            if (!ok && prez > 500)
            {
                txt_prezzo.Text = "";
                MessageBox.Show("Errore inserire prezzo valido");
            }
            else
            {
                ok = int.TryParse(txt_cilindrata.Text, out cil);
                if (!ok)
                {
                    txt_cilindrata.Text = "errore";
                    MessageBox.Show("Errore inserire cilindrata valida");
                }
            }
            ok = int.TryParse(txt_cilindrata.Text, out cil);
            if (!ok)
            {
                txt_cilindrata.Text = "errore";
                MessageBox.Show("Errore inserire cilindrata valida");
            }

            if (cmb_tipo.SelectedItem.ToString() == "Stradale" && txt_cilindrata.Text != "errore" && txt_cilindrata.Text != "errore")
            {
                moto[CountMoto] = new Stradali(txt_modello.Text, cil, cmb_motorizzazione.SelectedItem.ToString(), prez, cmb_carena.SelectedItem.ToString());
                cmb_mod.Items.Add(txt_modello.Text);
                CountMoto++;
            }
            else if (cmb_tipo.SelectedItem.ToString() == "Scooter" && txt_cilindrata.Text != "errore" && txt_cilindrata.Text != "errore")
            {
                moto[CountMoto] = new Scooter(txt_modello.Text, cil, cmb_motorizzazione.SelectedItem.ToString(), prez, cmb_bauletto.SelectedItem.ToString());
                cmb_mod.Items.Add(txt_modello.Text);
                CountMoto++;
            }
            else
            {
                MessageBox.Show("Moto non aggiunta al catalogo");
            }
        }
        private void btn_creaCaso_Click(object sender, RoutedEventArgs e)
        {
            Random rnd = new Random();
            int    a   = rnd.Next(0, 3);

            if (a == 0)
            {
                moto[CountMoto] = new Stradali("z750", 750, "4 tempi", 10000, "naked");
                cmb_mod.Items.Add(moto[CountMoto].mod);
            }
            else if (a == 1)
            {
                moto[CountMoto] = new Stradali("z800", 800, "4 tempi", 10000, "naked");
                cmb_mod.Items.Add(moto[CountMoto].mod);
            }

            else
            {
                moto[CountMoto] = new Stradali("ninja", 1000, "4 tempi", 10000, "cupolino");
                cmb_mod.Items.Add(moto[CountMoto].mod);
            }
            CountMoto++;
        }