void ItemAddedToLibrary(object sender, EventArgs e) { IndexArgs addedIndexArgs = e as IndexArgs; PrintItemWrapper item = LibraryData.Instance.GetPrintItemWrapper(addedIndexArgs.Index); LibraryRowItem libraryItem = new LibraryRowItem(item, this); AddChild(libraryItem, addedIndexArgs.Index); }
void ItemRemovedFromToLibrary(object sender, EventArgs e) { IndexArgs removeIndexArgs = e as IndexArgs; topToBottomItemList.RemoveChild(removeIndexArgs.Index); if (LibraryData.Instance.Count > 0) { SelectedIndex = Math.Max(SelectedIndex - 1, 0); } }