Expose grid entries

This commit is contained in:
Michael Bucari-Tovo 2022-05-11 18:45:57 -06:00
parent 936a1d60a0
commit dad36c73e5

View File

@ -37,6 +37,7 @@ namespace LibationWinForms
public partial class ProductsGrid : UserControl public partial class ProductsGrid : UserControl
{ {
internal event EventHandler<GridEntry> LiberateClicked;
ImageDisplay imageDisplay; ImageDisplay imageDisplay;
public event EventHandler<int> VisibleCountChanged; public event EventHandler<int> VisibleCountChanged;
@ -123,7 +124,7 @@ namespace LibationWinForms
displayWindow.Show(this); displayWindow.Show(this);
} }
private static async Task Liberate_Click(GridEntry liveGridEntry) private async Task Liberate_Click(GridEntry liveGridEntry)
{ {
var libraryBook = liveGridEntry.LibraryBook; var libraryBook = liveGridEntry.LibraryBook;
@ -270,6 +271,9 @@ namespace LibationWinForms
.Select(row => ((GridEntry)row.DataBoundItem).LibraryBook) .Select(row => ((GridEntry)row.DataBoundItem).LibraryBook)
.ToList(); .ToList();
internal IEnumerable<GridEntry> AllEntries
=> bindingList;
private GridEntry getGridEntry(int rowIndex) => _dataGridView.GetBoundItem<GridEntry>(rowIndex); private GridEntry getGridEntry(int rowIndex) => _dataGridView.GetBoundItem<GridEntry>(rowIndex);
#region Column Customizations #region Column Customizations