Skip to content

[Feature] Microsoft.Toolkit.Mvvm package (Preview 5) #3428

@Sergio0694

Description

@Sergio0694

Overview

This issue is meant to be used to track all the feature requests and discussions regarding API changes or other tweaks for the Microsoft.Toolkit.Mvvm package, which was introduced with #3230 and recently announced. 🎉

Find initial docs and samples here at https://aka.ms/mvvmtoolkit.

Key Tenants

  • Platform and Runtime Independent - .NET Standard 2.0 🚀 (UI Framework Agnostic)
  • Simple to pick-up and use - No strict requirements on Application structure or coding-paradigms (outside of 'MVVM'ness) i.e. flexible usage
  • À la carte - Developer able to choose the components they wish to leverage
  • Reference Implementation - Lean and performant, provides compliments to interfaces and paradigms hinted at in the Base-Class Library, but without provided implementations.

If you want more info on the package, you're welcome to browse our samples and preview documentation (here), watch the initial presentation by @michael-hawker and I (here) or watch Michael's presentation during the UNO Conf (here).

Tracking changes so far

Will be updating this list with all the current (work in progress) changes that are being included into a PR.

Preview 5 (#3562)

  • Added ObservableValidator.ClearErrors method
  • Added ObservableValidator.ValidateProperty method
  • Added ObservableValidator.ValidateAllProperties method
  • Added generic ObservableValidator.GetErrors method
  • Speed/memory optimizations to WeakReferenceMessenger on .NET Standard 2.0

Preview 4 (#3527)

  • Reintroduced Ioc class (see docs)
  • Added new ObservableObject.OnPropertyChanged(PropertyChangedEventArgs) overload
  • Added new ObservableObject.OnPropertyChanging(PropertyChangingEventArgs) overload
  • The OnPropertyChanged and OnPropertyChanging overloads with a string param are no longer virtual
  • Added notification support to IAsyncRelayCommand.CanBeCanceled property
  • Improved notification logic for other IAsyncRelayCommand properties
  • Added notification support to ObservableValidator.HasErrors property
  • Added new TrySetProperty methods to ObservableValidator
  • Minor performance/memory usage improvements and bug fixes

Preview 3 (shipped!) 🚀

ComponentModel, Input, DependencyInjection (#3429)

  • New ObservableValidator class for INotifyDataErrorInfo
  • Changed SetPropertyAndNotifyOnCompletion signature (7-14x faster, 60% memory usage reduction)
  • Changed signature of APIs, ditched Expression<Func<T>> args
  • Added new SetProperty<T, TModel> overload to allow stateless delegates and better performance
  • Added cancelation support to AsyncRelayCommand types (and interfaces)
  • Improved XML docs with info about exceptions being thrown by the various APIs
  • Removed Ioc class and Microsoft.Extensions.DependencyInjection dependency

Messenger (#3424)

  • Added a new WeakReferenceMessenger type
  • Renamed Messenger to StrongReferenceMessenger
  • Memory usage and performance improvements to StrongReferenceMessenger
  • Changed IMessenger.Register signature to remove closures (35% memory usage reduction, no this captured)
  • Added IMessenger.Cleanup API to help with extensibility
  • Changed default messenger for ObservableRecipient to WeakReferenceMessenger

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETComponents which are .NET based (non UWP specific)feature request 📬A request for new changes to improve functionalityopen discussion ☎️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions