private void Button_Click(object sender, RoutedEventArgs e) { string make = txbMake.Text; string model = txbModel.Text; string color = txbColor.Text; double price = Convert.ToDouble(txbPrice.Text); ListHolder.GetInstance().AddVroom(new Vroom(make, model, price, color, 0)); }
//ensures only one thread of the method that creates the instance to run public static ListHolder getInstance() { if (instance == null) { lock (padlock) { if (instance == null) { instance = new ListHolder(); } } } return(instance); }
private void btnRemove_Click(object sender, RoutedEventArgs e) { ListHolder.GetInstance().Vrooms.Remove((Vroom)lsbVrooms.SelectedItem); }
public MainWindow() { InitializeComponent(); lsbVrooms.ItemsSource = ListHolder.GetInstance().Vrooms; btnRemove.IsEnabled = false; }
public ReportWindow() { InitializeComponent(); rtbReport.AppendText(ListHolder.GetInstance().Report()); }