Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Releases: klemmchr/MvvmBlazor

v1.1.5

20 May 20:46
546daab
Compare
Choose a tag to compare

Fixes

  • #23 ViewModelBase.StateHasChanged was not working

Misc

  • Upgraded dependencies

v1.1.4

12 Oct 21:14
1fdcfab
Compare
Choose a tag to compare

Additions

  • Passing parameters to the binding context is now supported. Refer to the readme for usage. #11

Bugfixes

  • Binding for collections was broke. #12

v1.1.3

27 Sep 22:19
4fcc759
Compare
Choose a tag to compare

Changes

  • UseMvvm() has been removed as there is no need for it any more.

Bugfixes

  • Resolving a scoped service resulted in an exception. Now it's possible to also set scoped view models as a binding context.

Misc

  • Removed dependency on Microsoft.AspNetCore.Blazor.

v1.1.2

25 Sep 19:39
fed13dc
Compare
Choose a tag to compare

Additions

  • View models for blazor serverside are now resolved from the http context service provider. This allows to access services like IHttpContextAccessor. Blazor will get the services from the root dependency provider.

v1.1.1

25 Sep 10:38
8fff0d8
Compare
Choose a tag to compare

Bugfixes

  • Resolving a scoped service resulted in an exception. Now it's possible to also set scoped view models as a binding context.

v1.1.0

23 Sep 20:44
a12f4b4
Compare
Choose a tag to compare

This update brings compatibility with .NET Core 3.0 and introduces breaking changes (as .NET Core did).

Breaking changes

  • The name of the component base class has been changed from ComponentBaseMvvm to MvvmComponentBase. This base class provides basic functionality but does not expose any lifecycle methods.
  • Components need to inherit from MvvmComponentBase<T> where T is the type of the view model that should be set as the binding context. It will be resolved from the DI container automatically. Use @inherits MvvmComponentBase<T> in your component.
  • Remove any view model injections in your component where they are set as a binding context. Instead switch to the new component base class mentioned above.
  • Remove the method SetBindingContext() from your components. The binding context is now automatically resolved and set for you.
  • Bindings on the binding context now support LINQ expressions for the binding context. Given a view model that has the property Forecasts you can use this code to generate a binding Bind(x => x.Forecasts).
  • Remove the layout directive. The base class LayoutComponentBaseMvvm has been deleted as there is no further need for it.
  • The own implementation of ObservableCollection has been removed since it's implementation isn't working any more and it is out of scope for a lightweight MVVM solution.
  • You now need to register the library in your DI container via AddMvvm().
  • You also need to register the library in your Application Builder. Use UseMvvm() for IApplicationBuilder or IComponentsApplicationBuilder.
  • Rename OnInit() to OnInitialized() in your view models.
  • Rename OnInitAsync() to OnInitializedAsync() in your view models.,
  • Add the parameter bool firstRender to OnAfterRender() and OnAfterRenderAsync() in your view models.
    -ViewModelBase.Cleanup() is gone. Instead, override ViewModelBase.Dispose(bool disposing).

Additions

  • ViewModelBase now also exposes SetParametersAsync(ParameterView parameters). You can now use it from your view models.

Bugfixes

  • StateHasChanged() was not working. Now it will correctly rerender the component.

Misc

  • The examples now contain some explanation and a Clock demonstration to illustrate how easy background updating properties work.

v1.0.5

15 Sep 01:29
Compare
Choose a tag to compare

Initial Release