IDynamicGrid.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. using Syncfusion.Data;
  10. namespace InABox.DynamicGrid
  11. {
  12. public enum DynamicGridButtonPosition
  13. {
  14. Left,
  15. Right
  16. }
  17. public interface IDynamicGrid
  18. {
  19. FluentList<DynamicGridOption> Options { get; }
  20. Thickness Margin { get; set; }
  21. DynamicGridColumns MasterColumns { get; }
  22. DynamicGridColumns VisibleColumns { get; }
  23. CoreTable Data { get; set; }
  24. CoreRow[] SelectedRows { get; set; }
  25. double RowHeight { get; set; }
  26. double HeaderHeight { get; set; }
  27. double FontSize { get; set; }
  28. void Refresh(bool columns, bool data);
  29. void InitialiseEditorForm(IDynamicEditorForm editor, object[] items, Func<Type, CoreTable>? pageDataHandler = null, bool preloadPages = false);
  30. bool EditItems(object[] items, Func<Type, CoreTable>? PageDataHandler = null, bool PreloadPages = false);
  31. //bool DirectEdit(CoreTable data);
  32. event OnFilterRecord OnFilterRecord;
  33. event OnCreateItem OnCreateItem;
  34. event OnDoubleClick? OnDoubleClick;
  35. void AddVisualFilter(string column, string value, FilterType filtertype = FilterType.Contains);
  36. Button AddButton(string caption, BitmapImage? image, string? tooltip, Func<Button, CoreRow[], bool> action, DynamicGridButtonPosition position = DynamicGridButtonPosition.Left);
  37. event OnDefineFilter OnDefineFilter;
  38. event OnPrintData OnPrintData;
  39. event OnCustomiseColumns OnCustomiseColumns;
  40. event BeforeRefreshEventHandler BeforeRefresh;
  41. event AfterRefreshEventHandler AfterRefresh;
  42. event EntitySaveEvent? OnAfterSave;
  43. event EntitySaveEvent? OnBeforeSave;
  44. int DesiredWidth();
  45. void ConfigureColumns(DynamicGridColumns columns /*, bool dolookups */);
  46. void AddHiddenColumn(string column);
  47. void UpdateRow<TType>(CoreRow row, string column, TType value, bool refresh = true);
  48. void UpdateRow<T, TType>(CoreRow row, Expression<Func<T, TType>> column, TType value, bool refresh = true);
  49. }
  50. }