private void Add_Click(object sender, RoutedEventArgs e) { CollectionItem item = manager.AddItem(this); if (item != null) { item.Selected += () => Deselect(); item.DoubleClick += () => Update_Click(null, null); pnlContent.Children.Add(item); items.Add(item); } }