iTranslated by AI
ReactiveProperty v9.1 Released
ReactiveProperty v9.1 has been released.
This update primarily focuses on functional improvements when using ReactiveProperty with Blazor.
- Fixed an issue where validation was sometimes not performed correctly when calling
ForceNotifyonValidatableReactiveProperty<T>. - Added the
IsDisabledextension method toICommand, which returns the opposite result ofCanExecute. - Supported
ValidatableReactiveProperty<T>in theReactivePropertiesValidatorcomponent.
Update Highlights
IsDisabled extension method for command-related classes
We have added the IsDisabled extension method. This extension method returns the inverse result of the CanExecute method. It is intended for use with the disabled attribute in elements like button.
While it might not make a huge difference whether it exists or not, it's more convenient to have, so we added it. It is used as follows:
<button
@onclick="() => someViewModel.SomeCommand.Execute()"
disabled="@someViewModel.SomeCommand.IsDisabled()">
Click Me
</button>
Without IsDisabled, you would write something like disabled=@(!someViewModel.SomeCommand.CanExecute()), but having to use parentheses is a bit tedious, so I added it as an extension method.
Improvement of the ReactivePropertiesValidator component
We added ValidatableReactiveProperty<T> in ReactiveProperty v9.0.0. Personally, I believe it's better to replace ReactiveProperty<T> with ReactivePropertySlim<T> and ValidatableReactiveProperty<T> going forward.
The issue here (though I suspect there are few users, so no one has pointed it out) was with the ReactivePropertiesValidator component, which links Blazor's EditForm validation with ReactiveProperty<T> validation. I have updated it to work correctly even with ValidatableReactiveProperty<T>.
With this update, I believe there will no longer be a need to use ReactiveProperty<T> when introducing ReactiveProperty to Blazor.
Is there any merit in using ReactiveProperty with Blazor?
While it might not be as significant as in WPF, I think it's reasonably useful if you are establishing a ViewModel-like layer.
Since Blazor handles screen updates quite well even without explicit change notifications, you might not feel the benefits of ReactivePropertySlim<T> or ValidatableReactiveProperty<T> in many cases. However, I believe AsyncReactiveCommand is convenient because it allows you to synchronize the execution status across multiple commands.
Summary
So, the v9 series has reached a milestone for now. Next up is the documentation...
Discussion