BudgetAnalyser.LedgerBook.LedgerBookGridBuilderV2.BuildGrid C# (CSharp) Method

BuildGrid() public method

This is drawn programatically because the dimensions of the ledger book grid are two-dimensional and dynamic. Unknown number of columns and many rows. ListView and DataGrid dont work well.
public BuildGrid ( Engine currentLedgerBook, System.Windows.ResourceDictionary viewResources, ContentPresenter contentPanel, int numberOfMonthsToShow ) : void
currentLedgerBook Engine
viewResources System.Windows.ResourceDictionary
contentPanel System.Windows.Controls.ContentPresenter
numberOfMonthsToShow int
return void
        public void BuildGrid(
            Engine.Ledger.LedgerBook currentLedgerBook,
            ResourceDictionary viewResources,
            ContentPresenter contentPanel,
            int numberOfMonthsToShow)
        {
            if (viewResources == null)
            {
                throw new ArgumentNullException(nameof(viewResources));
            }

            if (contentPanel == null)
            {
                throw new ArgumentNullException(nameof(contentPanel));
            }

            this.ledgerBook = currentLedgerBook;
            this.localResources = viewResources;
            this.contentPresenter = contentPanel;
            DynamicallyCreateLedgerBookGrid(numberOfMonthsToShow);
        }