private void Button_AddImageReceiver_Click(object sender, System.Windows.RoutedEventArgs e) { int i = 0; while (true) { if (this.List_ImageReceiver.Find(k => k.ImageReceiveID == i) == null) { break; } ++i; } var item = new ImageReceiverPanel(i); item.Initialize(base.m_MainWindow); this.List_ImageReceiver.Add(item); this.m_MainWindow.AddPanel(item); this.m_MainWindow.DisplayPanel(item); this.UpdateListBox(); }