private void addButton_Click (object sender, RoutedEventArgs e) { listBox.Items.Add (new ListBoxItem () { Content = new TextBlock () { Text = String.Format ("Item {0}", count) } }); count++; }