Dispatcher.UIThread.Invoke is not successfully setting a property #16909
Unanswered
reelthymeos
asked this question in
Q&A
Replies: 2 comments 8 replies
-
Can you show the XAML for the TextBlock, or how the TextBlock is otherwise being bound to Response? Also does GetMyString actually get a non-empty string? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Here is a minimum sample that reproduces the issue: https://github.com/reelthymeos/MinimumSample4563 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have text that is not being displayed in a TextBlock. The 'Text' property of that block is bound to my property named 'Response' ( Text = "{Binding Response}"), and I structured that property how one usually would:
I have a button in my View which has its Command property bound to a Command method. This method called OnSendCommand is shown below.
When I press the button and this command fires, it executes the Dispatcher line to update the property 'Response', but the property continues to show a value of null after the statement is executed. Subsequently when the Getter is called for the property, it returns null and thus the TextBlock is empty. The Command method fires again and updates the property correctly, but by then the Getter has been called already so the text block never updates.
STEPS I TRIED:
EDIT:
I have attached a project that is a minimum sample that reproduces this issue.
Beta Was this translation helpful? Give feedback.
All reactions