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

How to react multiple Changes #62

Open
marcoferre opened this issue Jun 3, 2021 · 2 comments
Open

How to react multiple Changes #62

marcoferre opened this issue Jun 3, 2021 · 2 comments

Comments

@marcoferre
Copy link

Hi,

I need to wait continuosly new Reaction on Changes of a node that i'm inspecting.

With the code in the documentation:

var valueChanged = new TaskCompletionSource<string>();
positionParameter.PropertyChanged += (s, e) => valueChanged.SetResult(((IElement)s).GetPath());

Console.WriteLine("Waiting for the parameter to change...");
Console.WriteLine("A value of the element with the path {0} has been changed.", await valueChanged.Task);

is possible to wait and listen only the first change.

My request to help deal with the possibility to listen all the changes of a node (ie: every time a FaderPosition change, update a view with the value). How can I do That?

Thanks a lot

@sronline
Copy link

you can create multiple listeners:

var valueChanged = new TaskCompletionSource();
positionParameter.PropertyChanged += (s, e) => valueChanged.SetResult(((IElement)s).GetPath());
otherParameter.PropertyChanged += (s, e) => valueChanged.SetResult(((IElement)s).GetPath());`

Console.WriteLine("Waiting for the parameter to change...");
Console.WriteLine("A value of the element with the path {0} has been changed.", await valueChanged.Task);`

@sronline
Copy link

But if multiple changes are done at the same time information is lost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants