CoreDataModel.cs 900 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections.Generic;
  2. using System.ComponentModel;
  3. using System.Runtime.CompilerServices;
  4. using InABox.Core;
  5. namespace comal.timesheets
  6. {
  7. public abstract class CoreDataModel<TEntity> : ICoreDataModel
  8. {
  9. #region INotifyPropertyChanged
  10. public event PropertyChangedEventHandler PropertyChanged;
  11. protected bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
  12. {
  13. if (EqualityComparer<T>.Default.Equals(field, value)) return false;
  14. field = value;
  15. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  16. return true;
  17. }
  18. #endregion
  19. // Use "new" to replace this with your actual columns
  20. public abstract Columns<TEntity> Columns { get; }
  21. public IColumns GetColumns() => Columns;
  22. }
  23. }