DynamicTextColumn.cs 569 B

12345678910111213141516171819202122
  1. using InABox.Core;
  2. namespace InABox.DynamicGrid;
  3. public class DynamicTextColumn : DynamicActionColumn
  4. {
  5. public delegate string GetTextDelegate(CoreRow? row);
  6. public GetTextDelegate Text { get; private set; }
  7. public Alignment Alignment { get; set; }
  8. public DynamicTextColumn(GetTextDelegate text, ActionDelegate? action = null)
  9. {
  10. Alignment = Alignment.MiddleCenter;
  11. Text = text;
  12. Action = action;
  13. VerticalHeader = false;
  14. }
  15. public override object? Data(CoreRow? row) => Text?.Invoke(row);
  16. }