void slettKnapp_Click(object sender, RoutedEventArgs e)
 {
     if (tilvalggruppeListBox.SelectedItem != null && tilvalggruppeListBox.SelectedItem is TilvalgGruppe)
     {
         TilvalgGruppeListe.Remove(tilvalggruppeListBox.SelectedItem as TilvalgGruppe);
     }
 }
        void nyTilvalgGruppe_Click(object sender, RoutedEventArgs e)
        {
            string gruppeTittel = Microsoft.VisualBasic.Interaction.InputBox("Skriv inn tittel på tilvalggruppen", "Corinor prisforslag", "");

            if (!string.IsNullOrEmpty(gruppeTittel))
            {
                TilvalgGruppe tilvalgGruppe = new TilvalgGruppe(gruppeTittel, Modell.Produkt.DelingType.Begge);
                tilvalgGruppe.tilvalgListe.Add(new TilvalgElement(gruppeTittel, 0, TilvalgElement.PrisBeregningType.normal, 0));
                TilvalgGruppeListe.Add(tilvalgGruppe);
                tilvalggruppeListBox.SelectedItem = tilvalgGruppe;
                tilvalggruppeListBox.ScrollIntoView(tilvalgGruppe);
            }
        }
        void nedKnapp_Click(object sender, RoutedEventArgs e)
        {
            if (!(tilvalggruppeListBox.SelectedItem is TilvalgGruppe))
            {
                return;
            }

            if (tilvalggruppeListBox.SelectedIndex < tilvalggruppeListBox.Items.Count - 1)
            {
                TilvalgGruppeListe.Move(tilvalggruppeListBox.SelectedIndex, tilvalggruppeListBox.SelectedIndex + 1);
            }

            tilvalggruppeListBox.ScrollIntoView(tilvalggruppeListBox.SelectedItem as TilvalgGruppe);
        }