uno.extensions
uno.extensions copied to clipboard
[Reactive] Add ability to create a state from a standard property
What would you like to be added:
Something like:
public interface IService
{
public bool IsSomething { get; set; }
}
public IState<bool> IsSomething => State.FromProperty(
_svc,
get: svc => svc.IsSomething,
set: value => svc.IsSomething = value);
Using the
PropertySelectorwe should be able to declare something likepublic IState<bool> IsSomething => State.FromProperty(_svc, svc => svc.IsSomething)But for now thePropertySelectoris restricted torecord
Why is this needed:
To adapt an external component that is not feed aware
Discussion
- How do we support changes ? Should we automatically hook to INPC if svc does implement it ? Should we add a delegate to subscribe to custom
IsSomethingChangedevents ?