Class VisibleRowsGuarantee
Keeps a list or grid screen view's MinHeight in sync with the height needed to show the column headers, the horizontal scroll bar when present, and MinimumVisibleRows rows of its DataGrid. The MinHeight is also the view's natural height inside a section (the view caps its desire to it when measured with unbounded height, since further rows scroll), so it is both what an embedded collection takes by default and what stops the user shrinking its section below it.
public static class VisibleRowsGuarantee
- Inheritance
-
VisibleRowsGuarantee
- Inherited Members
Fields
InitialEstimate
MinHeight until the grid loads and the real metrics are known.
public const double InitialEstimate = 112
Field Value
LayoutRowHeightProperty
The height one row actually occupies in the current theme, grid lines included - the value the row-count reservation is built from. A theme author knows this (its MinRowHeight plus its grid line), whereas a live DataGrid does not until it has realised a row, which an empty grid - a common case - never does. Set on the DataGrid style; falls back to MinRowHeight when unset.
public static readonly DependencyProperty LayoutRowHeightProperty
Field Value
MinimumVisibleRows
How many rows a grid must always have room to show.
public const int MinimumVisibleRows = 4
Field Value
Methods
Attach(FrameworkElement, DataGrid, ScrollViewer)
public static void Attach(FrameworkElement view, DataGrid grid, ScrollViewer scrollViewer)
Parameters
viewFrameworkElementgridDataGridscrollViewerScrollViewer
GetLayoutRowHeight(DependencyObject)
public static double GetLayoutRowHeight(DependencyObject element)
Parameters
elementDependencyObject
Returns
SetLayoutRowHeight(DependencyObject, double)
public static void SetLayoutRowHeight(DependencyObject element, double value)
Parameters
elementDependencyObjectvaluedouble