public RepeaterControl(string label, DocumentManipulation.Repeater repeater) { this.repeater = repeater; InitializeComponent(); Label.Content = label; this.SetValue(Grid.RowProperty, repeater.Row); this.SetValue(Grid.ColumnProperty, repeater.Column); this.SetValue(Grid.ColumnSpanProperty, repeater.ColumnSpan); this.DataContext = this; _records = new ObservableCollection <Record>(); dataGrid.ItemsSource = Records; foreach (var header in repeater.GridHeaders()) { var binding = new Binding($"Attributes[{header.Index}]"); dataGrid.Columns.Add(new CustomBoundColumn() { Header = header.Label, Binding = binding, TemplateName = "CustomTemplate" }); } SetCountLabel(); }
public static Control GenerateRepeaterControl(string name, DocumentManipulation.Repeater repeater) { return(new RepeaterControl(name, repeater)); }