IDynamicGridUIComponent.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. {
  15. bool IsRefreshing { get; }
  16. bool CanSort();
  17. DynamicGridRowStyleSelector<T> RowStyleSelector { get; }
  18. void BeforeSelection(CancelEventArgs cancel);
  19. void SelectItems(CoreRow[] rows);
  20. void HandleKey(KeyEventArgs args);
  21. void LoadColumnsMenu(ContextMenu menu);
  22. void DoubleClickCell(CoreRow? row, DynamicColumnBase? column);
  23. void ExecuteActionColumn(DynamicActionColumn column, CoreRow[]? rows);
  24. void OpenColumnMenu(DynamicColumnBase column);
  25. void UpdateData(T obj, CoreRow row, string changedColumn, Dictionary<CoreColumn, object?> updates);
  26. void EntityChanged(T obj, CoreRow row, string changedColumn, Dictionary<string, object?> changes);
  27. void UpdateRecordCount(int count);
  28. public bool IsDirectEditMode(IEnumerable<DynamicGridOption>? options = null);
  29. void DragOver(object sender, DragEventArgs e);
  30. void Drop(object sender, DragEventArgs e);
  31. void DragStart(object? sender, CoreRow[] rows);
  32. }
  33. public interface IDynamicGridUIComponent<T>
  34. where T : BaseObject, new()
  35. {
  36. IDynamicGridUIComponentParent<T> Parent { set; }
  37. FrameworkElement Control { get; }
  38. CoreRow[] SelectedRows { get; set; }
  39. double RowHeight { get; set; }
  40. double HeaderRowHeight { get; set; }
  41. int DesiredWidth();
  42. /// <summary>
  43. /// Do any required updates when the options list is changed.
  44. /// </summary>
  45. /// <returns>Whether the columns need to be reloaded.</returns>
  46. bool OptionsChanged();
  47. void UpdateRow(CoreRow row);
  48. void UpdateCell(CoreRow row, string column, object? value);
  49. void AddVisualFilter(string column, string value, FilterType filtertype = FilterType.Contains);
  50. List<Tuple<string, FilterPredicate>> GetFilterPredicates();
  51. void BeforeRefresh();
  52. void RefreshColumns(DynamicGridColumns columns, DynamicActionColumns actionColumns);
  53. void RefreshData(CoreTable data);
  54. void InvalidateRow(CoreRow row);
  55. void ScrollIntoView(CoreRow row);
  56. CoreRow[] GetVisibleRows();
  57. }