You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see, oneWayMap represents an optimization over oneWay in the sense that PropertyChanged will not be triggered unless the return value of getter has changed. However, if there are multiple bindings from XAML to a single oneWayMap (e.g. one to display text and another to select a color based on the text using an IValueConverter), then the mapper will still be called several times.
It seems to me there should be a fairly simple fix wherein Elmish.WPF could use lazy to ensure that until the getter output has changed (or, if simpler, until the model is updated, though that's a lesser optimization), mapper is called at most once.
I haven't been able to figure out how, though. Any thoughts?
The text was updated successfully, but these errors were encountered:
As far as I can see,
oneWayMap
represents an optimization overoneWay
in the sense thatPropertyChanged
will not be triggered unless the return value ofgetter
has changed. However, if there are multiple bindings from XAML to a singleoneWayMap
(e.g. one to display text and another to select a color based on the text using an IValueConverter), then themapper
will still be called several times.It seems to me there should be a fairly simple fix wherein Elmish.WPF could use
lazy
to ensure that until thegetter
output has changed (or, if simpler, until the model is updated, though that's a lesser optimization),mapper
is called at most once.I haven't been able to figure out how, though. Any thoughts?
The text was updated successfully, but these errors were encountered: