IDynamicGrid.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #define scrolling
  2. //#define newgrid
  3. using System;
  4. using System.Linq.Expressions;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Media.Imaging;
  8. using InABox.Core;
  9. namespace InABox.DynamicGrid
  10. {
  11. public enum DynamicGridButtonPosition
  12. {
  13. Left,
  14. Right
  15. }
  16. public interface IDynamicGrid
  17. {
  18. FluentList<DynamicGridOption> Options { get; }
  19. Thickness Margin { get; set; }
  20. DynamicGridColumns MasterColumns { get; }
  21. DynamicGridColumns VisibleColumns { get; }
  22. CoreTable Data { get; set; }
  23. CoreRow[] SelectedRows { get; set; }
  24. double RowHeight { get; set; }
  25. double HeaderHeight { get; set; }
  26. double FontSize { get; set; }
  27. void Refresh(bool columns, bool data);
  28. void InitialiseEditorForm(IDynamicEditorForm editor, object[] items, Func<Type, CoreTable>? pageDataHandler = null, bool preloadPages = false);
  29. bool EditItems(object[] items, Func<Type, CoreTable>? PageDataHandler = null, bool PreloadPages = false);
  30. //bool DirectEdit(CoreTable data);
  31. event OnFilterRecord OnFilterRecord;
  32. event OnCreateItem OnCreateItem;
  33. event OnDoubleClick? OnDoubleClick;
  34. void AddVisualFilter(string column, string value);
  35. Button AddButton(string caption, BitmapImage? image, string? tooltip, Func<Button, CoreRow[], bool> action, DynamicGridButtonPosition position = DynamicGridButtonPosition.Left);
  36. event OnDefineFilter OnDefineFilter;
  37. event OnPrintData OnPrintData;
  38. event OnCustomiseColumns OnCustomiseColumns;
  39. event OnAfterReloadEventHandler OnAfterReload;
  40. int DesiredWidth();
  41. void ConfigureColumns(DynamicGridColumns columns /*, bool dolookups */);
  42. void AddHiddenColumn(string column);
  43. void UpdateRow<TType>(CoreRow row, string column, TType value, bool refresh = true);
  44. void UpdateRow<T, TType>(CoreRow row, Expression<Func<T, TType>> column, TType value, bool refresh = true);
  45. }
  46. }