Class Repeater
Repeats an ItemTemplate once per item in a bound collection - a server list, a character roster, a download queue.
public class Repeater : Control
- Inheritance
-
Repeater
- Inherited Members
Remarks
The schema could previously only describe a fixed set of controls, so every
variable-length list had to be hand-built in C#, which put the one part of a screen most
worth reskinning back out of reach of the view file. Bindings inside the item template
resolve against the item, not the view model - that's the whole point - so
Text="{Binding Name}" on a row label reads each item's own Name.
Rows are display-only in this version: interactive controls inside a template are built and drawn but receive no input, because a view collects its focusable controls once when it initialises and generated rows arrive later. The repeater handles row selection and activation itself, which covers picking from a list; a per-row button does not work yet.
Properties
ActivateCommand
The name of a view model ICommand property to run when a row is double-clicked or
activated with Enter.
public string ActivateCommand { get; set; }
Property Value
BorderColor
The color of a border drawn around the whole list.
public string BorderColor { get; set; }
Property Value
BorderThickness
The border's width in pixels. Has no effect unless BorderColor is set. One by default.
[Range(0, 2147483647)]
public int BorderThickness { get; set; }
Property Value
FillColor
A flat fill drawn behind every row.
public string FillColor { get; set; }
Property Value
FocusColor
An outline drawn around the selected row, or around the whole list when nothing is selected, while the list has keyboard focus.
public string FocusColor { get; set; }
Property Value
HoverColor
The fill drawn behind the row under the pointer.
public string HoverColor { get; set; }
Property Value
ItemSpacing
The gap in pixels between rows. Zero by default.
public int ItemSpacing { get; set; }
Property Value
ItemTemplate
The control tree built once per item. Holds exactly one layout.
[Required]
public RepeaterItemTemplate ItemTemplate { get; set; }
Property Value
ItemsSourceBinding
The view model property the rows come from, when ItemsSource was a binding; otherwise
null.
public string ItemsSourceBinding { get; set; }
Property Value
ItemsSourceValue
The ItemsSource attribute's text: a binding to a property that returns an
IEnumerable. Required.
[Required]
public string ItemsSourceValue { get; set; }
Property Value
MaxExtent
The largest the list may grow along its orientation, in pixels. Rows past that are scrolled to.
[Range(0, 2147483647)]
public int MaxExtent { get; set; }
Property Value
Orientation
The direction the rows are laid out in. Vertical by default.
[EnumDataType(typeof(Orientation))]
public Orientation Orientation { get; set; }
Property Value
Padding
The padding in pixels inside the list, around the rows. Zero on every side by default.
public Spacing Padding { get; set; }
Property Value
PaddingValue
The Padding attribute's text form. Use Padding in code.
public string PaddingValue { get; set; }
Property Value
ScrollIndicatorColor
The color of the scroll indicator shown when the rows do not all fit.
public string ScrollIndicatorColor { get; set; }
Property Value
SelectedItem
The name of a view model property the selected item is written back to. Setting it makes the rows selectable.
public string SelectedItem { get; set; }
Property Value
SelectionColor
The fill drawn behind the selected row.
public string SelectionColor { get; set; }
Property Value
SelectionMarkerColor
The color of a marker drawn down the left edge of the selected row.
public string SelectionMarkerColor { get; set; }
Property Value
SelectionMarkerThickness
The width in pixels of the selected row's left-edge marker. Two by default.
[Range(0, 2147483647)]
public int SelectionMarkerThickness { get; set; }
Property Value
Size
The size of the list in pixels. A height caps how tall the list grows; rows that do not fit are scrolled to rather than clipped.
public Size Size { get; set; }
Property Value
SizeValue
The Size attribute's text form. See Size.
public string SizeValue { get; set; }
Property Value
Stretch
Whether the list takes the size its parent layout gives it, rather than sizing to its rows.
public bool Stretch { get; set; }