// Add a new row to the column public MetroRow AddRow() { var newRow = new MetroRow(this); Rows.Add(newRow); // Return the row object so it can be worked with return newRow; }
// Add a new row to the column public MetroRow AddRow() { var newRow = new MetroRow(this); Rows.Add(newRow); // Return the row object so it can be worked with return(newRow); }
// Initialize our object, the column object this row will belong is required public MetroRow(MetroColumn column) { this.Column = column; // Get the last row of our column to calculate the top of this row MetroRow lastRowAdded = this.Column.Rows.LastOrDefault(); this.TopMargin = 0; // If there are no rows in this column yet, this is the first if (lastRowAdded == null) { this.TopMargin = column.TilesTopMargin; } else { // Calculate based on previous row this.TopMargin = lastRowAdded.TopMargin + lastRowAdded.Height + column.SpacingBetweenTiles; } // All rows need a list to hold their tiles this.Tiles = new List <MetroTile>(); }