IDynamicGridUIComponent.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using InABox.Core;
  2. using Syncfusion.Data;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Input;
  12. namespace InABox.DynamicGrid;
  13. public interface IDynamicGridUIComponentParent<T> : IDynamicGrid<T>
  14. where T : BaseObject, new()
  15. {
  16. bool IsRefreshing { get; }
  17. bool CanSort();
  18. DynamicGridRowStyleSelector<T> RowStyleSelector { get; }
  19. void BeforeSelection(CancelEventArgs cancel);
  20. void SelectItems(CoreRow[] rows);
  21. void HandleKey(KeyEventArgs args);
  22. void LoadColumnsMenu(ContextMenu menu);
  23. void DoubleClickCell(CoreRow? row, DynamicColumnBase? column);
  24. void ExecuteActionColumn(DynamicActionColumn column, CoreRow[]? rows);
  25. void OpenColumnMenu(DynamicColumnBase column);
  26. void UpdateData(T obj, CoreRow row, string changedColumn, Dictionary<CoreColumn, object?> updates);
  27. void EntityChanged(T obj, CoreRow row, string changedColumn, Dictionary<string, object?> changes);
  28. void UpdateRecordCount(int count);
  29. public bool IsDirectEditMode();
  30. void DragOver(object sender, DragEventArgs e);
  31. void Drop(object sender, DragEventArgs e);
  32. void DragStart(object? sender, CoreRow[] rows);
  33. void UIFilterChanged(object sender);
  34. IEnumerable<string>? GetColumnFilterItems(DynamicColumnBase column);
  35. }
  36. public interface IDynamicGridUIComponent<T>
  37. where T : BaseObject, new()
  38. {
  39. IDynamicGridUIComponentParent<T> Parent { set; }
  40. FrameworkElement Control { get; }
  41. CoreRow[] SelectedRows { get; set; }
  42. double RowHeight { get; set; }
  43. double HeaderRowHeight { get; set; }
  44. int DesiredWidth();
  45. /// <summary>
  46. /// Do any required updates when the options list is changed.
  47. /// </summary>
  48. /// <returns>Whether the columns need to be reloaded.</returns>
  49. bool OptionsChanged();
  50. void UpdateRow(CoreRow row);
  51. void UpdateCell(CoreRow row, string column, object? value);
  52. void AddVisualFilter(string column, string value, FilterType filtertype = FilterType.Contains);
  53. List<Tuple<string, Func<CoreRow, bool>>> GetFilterPredicates();
  54. void BeforeRefresh();
  55. void RefreshColumns(DynamicGridColumns columns, DynamicActionColumns actionColumns, DynamicGridColumnGroupings groupings);
  56. void RefreshData(CoreTable data);
  57. void InvalidateRow(CoreRow row);
  58. void ScrollIntoView(CoreRow row);
  59. CoreRow[] GetVisibleRows();
  60. }