Smaragd v5.0 Release Notes

Release Date: 2019-08-15 // over 4 years ago
  • ๐Ÿš€ This release introduces a refactoring of many classes and interfaces included in this library. This reduces complexity, enables better testability and provides better performance.
    ๐Ÿ“š There are also new features, like the added support for WeakReference<T> storage fields, updated XML documentation and more unittests.

    A more detailed summary of the changes:

    Bindable

    • โœ‚ remove IRaisePropertyChanging and IRaisePropertyChanged interfaces and change methods to protected visibility
    • ๐Ÿ“‡ rename RaisePropertyChanging method to NotifyPropertyChanging
    • ๐Ÿ“‡ rename RaisePropertyChanged method to NotifyPropertyChanged
    • โœ‚ remove virtual keyword from PropertyChanging and PropertyChanged eventhandlers
    • ๐Ÿ‘ allow propertyName to be null in NotifyPropertyChanging, NotifyPropertyChanged and SetProperty methods
    • โž• add overload for SetProperty method for setting WeakReference<T> storage fields
    • โž• add overloads for SetProperty method without the oldValue out parameter
    • โž• add comparer parameter to SetProperty methods

    ComputedBindable and ViewModel

    • โœ‚ remove ComputedBindable class and move logic to ViewModel class
    • โœ‚ remove Commands dictionary from ViewModel class
    • โž• add virtual keyword to IsDirty, Parent and IsUpdating properties

    ValidatingViewModel

    • โœ‚ remove IRaiseErrorsChanged interface and change method to protected visibility
    • ๐Ÿ‘€ rename RaiseErrorsChanged method to NotifyErrorsChanged
    • โœ‚ remove virtual keyword from ErrorsChanged eventhandler
    • set multiple validation errors per property by using SetErrors()
    • โž• add overload to GetErrors method with generic return type IEnumerable<string>
    • โœ‚ remove support for IDataErrorInfo interface
    • ๐Ÿ”„ change IValidation interface to generic in and out parameters
    • โœ‚ remove Validation<T> base class
    • โž• add FuncValidation class

    ViewModelCommand and AsyncViewModelCommand

    • โœ‚ remove IRaiseCanExecuteChanged interface and change method to protected visibility
    • ๐Ÿ“‡ rename RaiseCanExecuteChanged method to NotifyCanExecuteChanged
    • โœ‚ remove virtual keyword from CanExecuteChanged eventhandler
    • โœ‚ remove CanExecuteSourceAttribute class, use OnParentPropertyChanged instead
    • implement and automatically attach OnParentPropertyChanging and OnParentPropertyChanged methods to Parent
    • properly raise events on PropertyChanging and PropertyChanged eventhandlers when IsWorking is about to change or has changed
    • check if the returned task from the ExecuteAsync method is null before awaiting it