elmish / Elmish.WPF

Static WPF views for elmish programs
Other
421 stars 68 forks source link

Feature request: View model member exposed as Action<T> #574

Closed LyndonGingerich closed 11 months ago

LyndonGingerich commented 11 months ago

When working with Elmish.WPF from WPF C# code-behind, I dislike using ICommand because it is untyped. OneWayToSourceT bindings are quite helpful, but sometimes I want to pass the call to a different part of my app as an Action<T>. Then I have to create a lambda manually that takes the new value and sets it. What would you think of implementing a setter binding type that is exposed directly as an Action<T>?

LyndonGingerich commented 11 months ago

@marner2 Says that using code-behind is a hack and we shouldn't adjust Elmish.WPF to facilitate it. :P

TysonMN commented 11 months ago

Indeed. Typically use code behind only if that is the only solution.