TreeViewRowTemplate.cs 853 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. namespace crown_tests.GtkExt
  4. {
  5. public class TreeViewRowTemplate
  6. {
  7. public Type TargetType;
  8. public Dictionary<String, BindingInfo> ColumnBindings;
  9. public TreeViewRowTemplate(Type targetType)
  10. {
  11. this.TargetType = targetType;
  12. this.ColumnBindings = new Dictionary<string, BindingInfo>();
  13. }
  14. public static TreeViewRowTemplate Create(Type targetType)
  15. {
  16. return new TreeViewRowTemplate(targetType);
  17. }
  18. public TreeViewRowTemplate SetBinding(String colName, String path)
  19. {
  20. ColumnBindings.Add(colName, new BindingInfo() { Path = path });
  21. return this;
  22. }
  23. public TreeViewRowTemplate SetBinding(String colName, String path, Func<object, object> Converter)
  24. {
  25. ColumnBindings.Add(colName, new BindingInfo() { Path = path, Converter = Converter });
  26. return this;
  27. }
  28. }
  29. }