It is possible to write value to IReadOnlyBindableReactiveProperty<T>, which should be read-only.
Details
While the Value property does not have a setter in C# code, preventing direct modification.
But binding from XAML (e.g., to ListView.SelectedItem) will also set the value.
Additional Information
When using IReadOnlyReactiveProperty<T> from runceel/ReactiveProperty, a System.Windows.Markup.XamlParseException occurs immediately after execution.
In the #234, I had said that I would not fix this problem, but
I have decided to fix it by wrapping it in a ReadOnly type and correctly propagating events.
v1.2.6 is now correctly ReadOnly.
cc: @runceel
I appreciate your quick fix and for introducing the discussion #234.
I mistakenly set up a TwoWay binding in XAML for a property that was defined as read-only in ViewModel, so this kind of security enhancement is very helpful for me.
Issue
It is possible to write value to
IReadOnlyBindableReactiveProperty<T>
, which should be read-only.Details
While the
Value
property does not have a setter in C# code, preventing direct modification. But binding from XAML (e.g., toListView.SelectedItem
) will also set the value.Additional Information
When using
IReadOnlyReactiveProperty<T>
from runceel/ReactiveProperty, aSystem.Windows.Markup.XamlParseException
occurs immediately after execution.Environment
Repository
R3Wpf.ROBindableRpDemo - GitHub