We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
when we use
Task.Run(()=> { A = 10; });
throw a runtime error
Text="{x:Bind A}"
The text was updated successfully, but these errors were encountered:
I suppose, setting A property raises PropertyChanged event. So that the value of the property is immediately set to the TextBlock’s Text property.
You can set control's property only in main thread. Updating UI from background thread is not supported in any (known me) UI frameworks.
Sorry, something went wrong.
Thanks. And could you please help me or provide a Solution to deal with this problem?
I need to update the binding property in the task /new thread
You can set properties in a background thread, but you have to delegate raising PropertyChanged event to the main thread.
As an example you could look here:
https://github.com/levitali/CompiledBindings/blob/master/source/XF/XFTest/ViewModels/SynchronizedObservableObject.cs
Though the project is for Xamarin Forms, there are compiler switches for many other UI frameworks.
No branches or pull requests
when we use
throw a runtime error
The text was updated successfully, but these errors were encountered: