Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two way binding for check button state #8

Merged
merged 2 commits into from
Feb 16, 2024
Merged

Add two way binding for check button state #8

merged 2 commits into from
Feb 16, 2024

Conversation

glopesdev
Copy link
Member

This PR introduces two way binding between view and view-model state for check-box button style controls in the package, i.e. in this case the Checked property. In general the same pattern will be followed for all other controls with state.

Almost all primitive controls are concerned with managing a single piece of state, and we want any changes in this state to be propagated as an observable sequence. To allow two way binding we replaced the UI change event source with a BehaviorSubject that is responsible for storing the state. Apart from signaling all changes, this subject can also be used as a binding source by the UI control, so that any external changes to the state are automatically reflected in the UI. Finally, the state is exposed through a configurable property which can be externalized in the workflow.

Aside from two way binding, this allows for state to persist between opening and closing of visualizer windows, and also for dynamically changing the state using other workflow inputs by externalizing and mapping the state property.

@glopesdev glopesdev added the feature New planned feature label Feb 15, 2024
@glopesdev glopesdev added this to the 0.1.0 milestone Feb 15, 2024
@glopesdev glopesdev merged commit 0fb8df2 into main Feb 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New planned feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant